Skip to content

Instantly share code, notes, and snippets.

@rquadling
Created August 24, 2017 15:33
Show Gist options
  • Save rquadling/29d37938b1001345c643eb9832bfda7f to your computer and use it in GitHub Desktop.
Save rquadling/29d37938b1001345c643eb9832bfda7f 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