How can I set scope for apiv2 PUT request? Edited

I'm working on an integration with a non-hipchat application that i would like to update a room topic on a certain schedule. We keep our Production Support on-call information in PagerDuty and you can create custom REST calls with variables that are sent based on event triggers. I'm trying to get the CURL command working with the /v2/room/room_number/topic API endpoint and i'm getting a 403 forbidden error that says the following. 

"error": 
"code": 403,
"message": "This action requires one of the following scopes: [u'admin_room']",
"type": "Forbidden"


I've tried setting the scope based on what's here
Here are some examples of curl commands i've tried that yeild the same 403 error... so i'm obviously not setting the scope correctly. I've also tried all of these from a REST client to make sure i wasn't screwing up the json format in the curl command and i'm getting the same result.

curl -X PUT '{"topic":"updated topic","capabilities": {"hipchatApiConsumer": {"scopes": ["admin_room"]}}}' -H 'Content-Type: application/json' REQUEST_URL

curl -X PUT '{"topic":"updated topic","scopes":"admin_rooms"}' -H 'Content-Type: application/json' REQUEST_URL
I've also tried creating a "group admin" token with the role of "admin" and i just get an invalid oauth session message when i tack the token on the end of the request URL. 
Can someone provide the correct json for setting this scope in the request, or explain how i'm supposed to be creating the token differently? I feel like i've exhausted my UI options, and I've been searching thuroughly without finding a solution. 

1 answer

0 votes

Hey David!


You should be able to create an APIv2 token with admin_room Scope via https://<your-team-domain>.hipchat.com/account/api > Create new token and select the admin_room Scope.

(!) Do note that you can select multiple Scopes to extend your token's capability.

Also, I'd like to encourage you to reach out to our Ecosystem Support Portal to work with our Dev Support team for advice on how you can make your Custom Integration work with HipChat. :)

Hope this helps!

Thank you so much Ryan!! I didn't realize i needed to hit that URI to make the tokens i was going into "group admin" to make the tokens. You rock man! Have a great day : ) 

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 14, 2018 in Hipchat Cloud

Hipchat Cloud and Stride End of Life: Just over 90 days away

Earlier this year we made the difficult decision to discontinue our team messaging tools, Stride and Hipchat. The end of life date for Stride and Hipchat Cloud is quickly approaching - February 15, 2...

514 views 0 2
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