Created
September 22, 2015 19:37
-
-
Save sirkirby/f747f6184a6dace22705 to your computer and use it in GitHub Desktop.
Send a slack notification from a windows command prompt using curl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -k -g -X POST -d "payload={\"text\":\"my important bot notification\", \"channel\":\"#monitoring\", \"username\":\"computer-bot\", \"icon_emoji\":\":computer:\"}" https://hooks.slack.com/services/XXXXXXXXX/XXXXXXXXX/XxXxXxXxXXXxxXXXxxx |
Hey, I'm a little bit late to this, but is it possible to add green/red color to the message? I managed to find that it's usually done via "attachments:"[
} "color:"#colorcode",
But how I pass it to this curl command?
Thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I started with slack's documentation here https://api.slack.com/incoming-webhooks, but their curl example would not run in a windows command shell. Above, i'm using command switches to ignore the ssl cert (
-k
) and the contents of the json payload (-g
) along with escaping each quote with a\
.