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

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Mar 26, 2018 in Hipchat Data Center

Migration of Hipchat server to Data Center - a retrospective

...able to use the clients After a bunch of testing (rooms, memberships, check for private message history, and most importantly - the custom emoticons!) nearly everything was looking as we needed, however...

442 views 2 6
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