Last active
July 5, 2016 03:38
-
-
Save kbens/d3e8a53dc91c116ef4c45cf730e28a43 to your computer and use it in GitHub Desktop.
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
# Testing Slack API | |
# psadminio.slack.com | |
notify="@YOUR_USERNAME" | |
gist="https://gist.github.com/kbens/d3e8a53dc91c116ef4c45cf730e28a43" | |
text="This is a test of the Slack API. - $gist \nPlease let $notify know that you recived this message!" | |
url="https://hooks.slack.com/services/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" | |
conttype="Content-type: application/json" | |
method="POST" | |
chan="@TEST_USER" | |
username="slack api tester" | |
icon=":sleuth_or_spy:" | |
data="\"channel\": \"$chan\",\"username\": \"$username\",\"text\":\"$text\",\"icon_emoji\": \"$icon\"" | |
response=$(curl -sbX $method -H "$conttype" --data "{$data}" $url) | |
echo "Data: $data" | |
echo "Response: $response" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment