Skip to content

Instantly share code, notes, and snippets.

@julia-mareike
Created June 16, 2020 01:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save julia-mareike/af9d62d17bb72a8fa994041fec507a22 to your computer and use it in GitHub Desktop.
Save julia-mareike/af9d62d17bb72a8fa994041fec507a22 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