Can I use the OAuth2 token from the XMPP API with the v2 REST API?

I am requesting a token using the XMPP API for HipChat according to this page: https://docs.atlassian.com/hipchat.xmpp/latest/xmpp/auth.html. I am trying to use this token in a curl request, like this:

 

$ curl "myserver.net/v2/room?auth_token=QygMot5ByF41YzW&auth_test=true"

But I get the following error:

{
"error": {
"code": 401,
"message": "Invalid OAuth session",
"type": "Unauthorized"
}

 

Should I be able to use the OAuth2 token from the XMPP API with the REST v2 API, or am I trying to do something which is not supported?

 

My end goal is to have my XMPP client be able to upload files to the HipChat server - should I do this in some other way?

 

Thanks.

1 answer

1 accepted

Accepted Answer
0 votes

I found the answer myself. The token received via the XMPP function mentioned is not an OAuth2 token. In an old wiki page, a different method for obtaining an OAuth2 token is mentioned: https://ecosystem.atlassian.net/wiki/display/HCDEV/HipChat+XMPP+Protocol+Documentation#HipChatXMPPProtocolDocumentation-Aquickauthmethod

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 10, 2018 in Hipchat

What should I think about when migrating HipChat to Slack?

...from the beginning. We have built up a lot of content in HipChat, with it being a core tool in our distributed company model. While it is true that we didn’t need to move to Slack immediately, we felt it...

490 views 1 10
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