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.

Revisions

  1. myururdurmaz revised this gist Feb 7, 2016. 1 changed file with 9 additions and 6 deletions.
    15 changes: 9 additions & 6 deletions hipchat-v2.sh
    Original file line number Diff line number Diff line change
    @@ -3,11 +3,14 @@
    # Set the ROOM_ID & AUTH_TOKEN variables below.
    # Further instructions at https://www.hipchat.com/docs/apiv2/auth

    ROOM_ID=XXX
    AUTH_TOKEN=XXX
    ROOM_ID=yourroomname
    OWNER_ID=XXXYYYX
    AUTH_TOKEN=XXXYYYXXX
    MESSAGE="Hello world!"

    curl -H "Content-Type: application/json" \
    -X POST \
    -d "{\"color\": \"purple\", \"message_format\": \"text\", \"message\": \"$MESSAGE\" }" \
    https://api.hipchat.com/v2/room/$ROOM_ID/notification?auth_token=$AUTH_TOKEN
    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
  2. @danriti danriti revised this gist Apr 23, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion hipchat-v2.sh
    Original file line number Diff line number Diff line change
    @@ -10,4 +10,4 @@ MESSAGE="Hello world!"
    curl -H "Content-Type: application/json" \
    -X POST \
    -d "{\"color\": \"purple\", \"message_format\": \"text\", \"message\": \"$MESSAGE\" }" \
    https://api.hipchat.com/v2/room/$ROOM_ID/message?auth_token=$AUTH_TOKEN
    https://api.hipchat.com/v2/room/$ROOM_ID/notification?auth_token=$AUTH_TOKEN
  3. @danriti danriti created this gist Nov 6, 2013.
    13 changes: 13 additions & 0 deletions hipchat-v2.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    #!/bin/bash

    # Set the ROOM_ID & AUTH_TOKEN variables below.
    # Further instructions at https://www.hipchat.com/docs/apiv2/auth

    ROOM_ID=XXX
    AUTH_TOKEN=XXX
    MESSAGE="Hello world!"

    curl -H "Content-Type: application/json" \
    -X POST \
    -d "{\"color\": \"purple\", \"message_format\": \"text\", \"message\": \"$MESSAGE\" }" \
    https://api.hipchat.com/v2/room/$ROOM_ID/message?auth_token=$AUTH_TOKEN