Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How can I use the hipchat API to setup a slash command

Kirk Friedman February 27, 2017

Consider the use case where I want to spin up a HipChat room to address a specific issue.  I can use the HipChat API to do so in an automated fashion.  As part of setting up that room, I want to give the users some capabilities, like /DoThis or /DoThat where the slash command posts to a given endpoint and takes responses back from it..  I could make those general features for all of HipChat (added as integrations to ANY room), but that has drawbacks.

Is there an API I can use with cURL (or otherwise) to add dynamically add a slash command to a room?

Thanks!

5 answers

1 vote
Nick Turskyi
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 28, 2017

Hi Kirk,

Sounds like an integration/addon is the right way to achieve that.

In order to perform actions in response to slash commands (any pattern in the user's message actually), you would use webhooks: https://www.hipchat.com/docs/apiv2/webhooks

Here is the comprehensive guide on how to start developing your integration with Atlassian Connect Express: https://developer.atlassian.com/hipchat/tutorials/getting-started-with-atlassian-connect-express-node-js - it even includes the sample slash command "/hello"!

Regards,

Nick

 

 

0 votes
Nick Turskyi
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 10, 2017

See my original answer - Atlassian Connect Express example works out of the box and implements the "/hello" slash command.

0 votes
vijayalakshmi March 9, 2017

Thanks Nick.

I Was actually looking for some scripts like when we post  to that URL , whats the script behind that code . Any working example i was looking for.

 

0 votes
Nick Turskyi
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 9, 2017

Hi Vijaya,

Make sure to check out this blog post as well - it has a nice walkthrough on setting up a simple slash command: https://blog.hipchat.com/2015/02/11/build-your-own-integration-with-hipchat/

Regards,

Nick

Steven Casey April 4, 2018

The link doesn't appear to work. Just redirects to a stride blog...

0 votes
vijayalakshmi March 9, 2017

That was interesting.

can you share some sample script , where your slash command worked. I would like to test slash command in HipChat

 

Thanks

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events