Skip to content

Instantly share code, notes, and snippets.

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 mkol5222/6f98ba245364a5fa76e64ea726290102 to your computer and use it in GitHub Desktop.
Save mkol5222/6f98ba245364a5fa76e64ea726290102 to your computer and use it in GitHub Desktop.
Send slack message via curl
#!/bin/bash
MESSAGE="Message"
SLACK_CHANNEL="#slack-channel"
SLACK_TOKEN=xoxb-1234-000000000000
curl -X POST \
-H "Authorization: Bearer $SLACK_TOKEN" \
-H "Content-type: application/json; charset=utf-8" \
--data '{"channel":"'$SLACK_CHANNEL'","text":"'"$MESSAGE"'"}' \
https://slack.com/api/chat.postMessage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment