Skip to content

Instantly share code, notes, and snippets.

@gordlea
Forked from rquadling/hipchat-v1.sh
Created August 1, 2018 14:57
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 gordlea/8648376febe936da4e4ae770a83acd88 to your computer and use it in GitHub Desktop.
Save gordlea/8648376febe936da4e4ae770a83acd88 to your computer and use it in GitHub Desktop.
Send an HTML message to HipChat using v1 of the api via cURL
MESSAGE="
<table><thead><tr><td colspan=\"2\"><b>Build starting</b></td></tr></thead>
<tbody>
<tr><td><b>Tag</b></td><td>${build_tag}</td></tr>
<tr><td><b>Built for</b></td><td>${built_for}</td></tr>
<tr><td><b>Built by</b></td><td>${built_by}</td></tr>
</tbody>
</table>
"
curl -s -X POST \
-F room_id=Developers \
-F from=GitLab \
-F message="$MESSAGE" \
-F notify=1 \
-F color=yellow \
-F message_format=html \
-F format=json \
-F auth_token=xxxxxxxxx \
https://api.hipchat.com/v1/rooms/message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment