It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

hip chat connect back end API with Add-On

I have followed the Tutorial Guide and setup a Node.js server to host my add-on.  I used the ACE framework to create the add-on as detailed in the Tutorial.  I can install the Add-on and it adds global web hooks, a glance and a sidebar.  When I try to use the back end api of the add-on to update anything (glance) or send  a message to any room nothing happens.  

Is their logging somewhere of the post commands to HipChat server where I can inspect if the sendMessage and updateGlance functions (came with the framework) are actually doing anything.

 

Thanks

1 answer

0 votes
crivers Atlassian Team Nov 04, 2016

Both the sendMessage and updateGlance methods use the general `request` method to perform the HTTP request. You should be able to pass a rejection function to handle the case where the request fails for some reason. For example

hipchat.sendMessage(req.clientInfo, req.identity.roomId, 'my message')
	.then(
        // this gets called if the request is successful
		function (data) { res.sendStatus(200); },
        // this gets called if the request fails
		function(reason) {  console.log('request failed: '+reason); }
	);

You can also modify the `request` method itself if you are having issues debugging why the request isn't getting completed. Any console.log call in your Node.js server code should show up in the terminal you're running it from

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Hipchat

Hipchat Cloud and Stride have reached End of Life (updated)

All good things come to an end - thanks to all our customers and partners who have been along the Hipchat and Stride journey with us.  As of Feb 15th 2019, Hipchat Cloud and Stride have reached ...

35,202 views 9 8
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you