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

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. 

"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
ryebenedict Atlassian Team Sep 15, 2017

Hey David!

You should be able to create an APIv2 token with admin_room Scope via https://<your-team-domain> > 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 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,207 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