How can my application send notifications to HipChat using an addon?

I am attempting to setup a simple addon to allow my application to send notifications to HipChat rooms.

I used the BYO integration for my first attempt. This worked great as it supplied me an apitoken my application can use when communicating with the HipChat rest api. The problem is I cannot seem to install this same BYO integration in multiple rooms.

My second attempt involved creating an addon to be installed by descriptor url. I have been able to install this in multiple rooms, but I do not see the apitoken to use.

How can I get an apitoken for my addon like the BYO integration addon? Is there a sample available, or a way to view the addon code for the BYO integration?

This is what my capabilities section looks like:

"capabilities": {
    "hipchatApiConsumer": {
      "fromName": "Build Notification",
      "scopes": [
        "send_notification"
      ]
    },
    "installable": {
      "allowGlobal": true,
      "allowRoom": true
    },
    "oauth2Provider": {
      "authorizationUrl": "https://www.hipchat.com/users/authorize",
      "tokenUrl": "https://api.hipchat.com/v2/oauth/token"
    }
  },

1 answer

1 vote

To get an OAuth access token so you can call the HipChat api, you actually have to generate one after you've received the oauth_id and secret at install time (this is posted to your installable.callbackUrl – which looks like is missing in your descriptor). The details are available here: https://developer.atlassian.com/hipchat/guide/installation-flow/server-side-installation

If you're using our nodejs framework for building an addon, the access token generation is handled for you automatically. I whipped up a simple add-on on HyperDev yesterday. Feel free to remix and test out on your own:

https://hyperdev.com/#!/project/walnut-braid

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 14, 2018 in Hipchat Cloud

Hipchat Cloud and Stride End of Life: Just over 90 days away

Earlier this year we made the difficult decision to discontinue our team messaging tools, Stride and Hipchat. The end of life date for Stride and Hipchat Cloud is quickly approaching - February 15, 2...

528 views 0 2
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you