-
-
Save mkol5222/6f98ba245364a5fa76e64ea726290102 to your computer and use it in GitHub Desktop.
Send slack message via 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
#!/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