Skip to content

Instantly share code, notes, and snippets.

@myururdurmaz
Forked from danriti/hipchat-v2.sh
Last active December 4, 2018 06:23
Show Gist options
  • Save myururdurmaz/ee13f4843f5538d86d80 to your computer and use it in GitHub Desktop.
Save myururdurmaz/ee13f4843f5538d86d80 to your computer and use it in GitHub Desktop.
HipChat API v2 - Send a message to a room using cURL
#!/bin/bash
# Set the ROOM_ID & AUTH_TOKEN variables below.
# Further instructions at https://www.hipchat.com/docs/apiv2/auth
ROOM_ID=yourroomname
OWNER_ID=XXXYYYX
AUTH_TOKEN=XXXYYYXXX
MESSAGE="Hello world!"
curl \
--header "content-type: application/json" \
--header "Authorization: Bearer $AUTH_TOKEN" \
-X POST \
-d "{\"name\":\"dev\",\"privacy\":\"private\",\"is_archived\":false,\"is_guest_accessible\":false,\"topic\":\"cURL\",\"message\":\"Message sent to HipChat from cURL\",\"color\":\"green\",\"owner\":{\"id\":$OWNER_ID}}" \
https://api.hipchat.com/v2/room/$ROOM_ID/notification
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment