We are using mattermost
as an internally hosted alternative to slack
.
How can I write to a channel in mattermost, for example by a script, using curl
?
I need to know:
- how to get an "integration key" from mattermost
- format of the
curl
command
An example of my script that works with slack
:
SLACK_URL='https://hooks.slack.com/services/my-long-integration-key'
message='Project XYZ was released successfully.'
curl -X POST -H "Content-Type: application/json" \
--data "{ \"channel\": \"#releases\", \"username\": \"$me\", \"text\": \"$MESSAGE\" }" \
$SLACK_URL &> /dev/null
Indeed there is a Mattermost API (equivalent to slack-api
) but I am struggling to a good example of what I want to do.
Thanks