Slack documentation has part about sending messages with webhooks.
It works great, but there is missing information about details. We can send custom message with emoji, username and selected channel.
{
"text": "My message.",
"channel": "notifications_channel",
"username": "My custom robot name",
"icon_emoji": "rocket"
}
When you send it from script or CI server you can use curl
in format:
curl -X POST \
-H 'Content-type: application/json' \
--data "{'text':'My message.', 'channel':'notifications_channel', 'username':'My custom robot name', 'icon_emoji':'rocket'}" \
$SLACK_WEBHOOK_URL
How message in Slack looks? First message is ours, second is from Trello application for comparation.
Top comments (0)