Skip to content

Instantly share code, notes, and snippets.

@meatherly
Created January 9, 2016 21:07
Show Gist options
  • Save meatherly/c895eea659ae55c4848f to your computer and use it in GitHub Desktop.
Save meatherly/c895eea659ae55c4848f to your computer and use it in GitHub Desktop.
Creating HipChat Connect add-ons notes

Creating HipChat Connect add-ons Notes

All this was created by reading all the sections under Extensions Points on this page.

This is just my general notes/guide on creating and implementing a HipChat Connect add-on. You can learn more here.

Descriptor

First you'll need to provide a Descriptor. You can provide this via REST endpoint on your server. Use this tool to validate your Descriptor: http://atlassian-connect-validator.herokuapp.com/validate?product=hipchat

Make sure you read the API for the add-on you wish to create to figure out the right values in the Descriptor. Most of them will use the Hipchat API to update the values of you add-on. If they do you'll want to you'll want to read about the server-side installation below.

Server-side installation

You'll then want to learn more about this server-side install flow: https://developer.atlassian.com/hipchat/guide/installation-flow/server-side-installation. This is only needed if you're going to be interacting with the HipChat API. In mosts cases you will. Once you get the OAuth tokens you'll want to save them to make authenticated requests to hipchat api.

Security

Most of the connect add-ons will have a url that hipchat will request to get information from. When it does it'll send a query param called signed_request which is a JWT. Most of the documentation on the specific add-on will tell you what this JWT contains. You can use a library to parse out the JWT (e.g. https://github.com/jwt/ruby-jwt). Hipchat hasn't mentioned anything about signing the JWT so I believe it'll be unsigned so use the unsigned function of the library of your choice to decode it.

The JWT will provide information such as room_id, user_id, group_id, etc. This gives you alot of options to authenticate the request.

Installation

Once you have your server running you'll want to go the integrations page for a hipchat room to install it. I have found the only way to install it is to click on the link at the bottom of the page that says Install an integration from a descriptor URL. You'll then give it the endpoint that returns your descriptor.

*Pro tip* Use ngrok (this can be installed using homebrew) for local development. Once you're ready to push it to production you can then delete the add-on and reinstall it with the production URL.

Other useful links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment