Skip to content

Instantly share code, notes, and snippets.

@naviat
Forked from stekhn/post-to-slack.sh
Created April 20, 2023 05:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save naviat/2e9053952742c9e5dcf8988c49a595ae to your computer and use it in GitHub Desktop.
Save naviat/2e9053952742c9e5dcf8988c49a595ae to your computer and use it in GitHub Desktop.
Post to Slack using curl on the command line. The incoming webhook for your Slack team needs to be created beforehand.
# Read more about Slack webhooks here: https://api.slack.com/messaging/webhooks
curl -X POST \
-H 'Content-type: application/json; charset=utf-8' \
--data '{ "channel": "#mychannel", "username": "superbot", "icon_emoji": ":bot:", "text": "Foo" }' \
https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment