Last active
March 6, 2019 23:47
-
-
Save peacefixation/bf3e166a6ac0cf3f0b7d80555cd279f9 to your computer and use it in GitHub Desktop.
Send a hipchat alert
This file contains hidden or 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 | |
# https://www.hipchat.com/docs/apiv2/method/send_room_notification | |
AUTH_TOKEN="" # generate an auth token from the hipchat admin interface | |
ROOM_ID=1 # get the room id from the hipchat admin interface | |
HIPCHAT_URL="https://api.hipchat.com/v2/room" # or self hosted hiphat URL | |
FROM="some sender" | |
MESSAGE="some message" | |
COLOR="red" | |
curl -H "Content-type: application/json" \ | |
-H "Authorization: Bearer ${AUTH_TOKEN}" \ | |
-X POST \ | |
-d "{\"from\": \"${FROM}\", \"message_format\": \"text\", \"message\": \"${MESSAGE}\", \"color\": \"${COLOR}\", \"notify\": \"true\"}" \ | |
${HIPCHAT_URL}/${ROOM_ID}/notification | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment