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

Invalid OAuth session getting Hipchat users list with new admin token

Rafael Corredor July 20, 2018

Hi,

 

We use Hipchat server, version 2.2.9, and we use 

https://hipchat-company.com/v2/user?auth_token=TOKEN&start-index=0&max-results=1000

to get the user list daily, but some days ago it stopped working (the same day, in Test and Prod environments). 

First idea has been to refresh tokens with new ones, creating it using option

https://hipchat-company.com/admin/api

We have created Admin and Notification tokens (in their respective instances), but in both cases the error still is:

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

 

 

What am I missing?

Thank you in advance

1 answer

0 votes
AhmadDanial
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 22, 2018

Hi there, Rafael.

Firstly, I suspect that you ran into the issue possibly due to the expiry of token since you mentioned that it stopped working. 

Next, the new token that you generated is referring to the API v1 token with reference to the URL you provided. In this case, I suggest you to generate a new API v2 token instead through https://<url>/account/api .

Please ensure that you have the right scope (with reference to the documentation here, you need to have the View Group scope). For example:

Screen Shot 2018-07-23 at 06.37.47.png

You will then see something that looks like this:

Screen Shot 2018-07-23 at 06.38.01.pngUse the new generated token and let me know if you are still running into any issues along the way.

Rafael Corredor July 23, 2018

Hi,

Yes! Verified it was the expired token.

But to generate the new one, to see those 'Scopes' Group Admin -> Api option cannot be used but Account Settings (from an admin user) -> API access options.

Then, the token can be created usign 'View Group' scope and it works.

 

Thank you

AhmadDanial
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 23, 2018

Hi, Rafael.

Oh, yes! Thank you for highlighting that one out specifically since it has to be a personal API v2 token rather than an API v1 token. 

Nevertheless, you are most welcome. Happy to know that it helps!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events