How to pass scope value while reading Hipchat room history via API?

Hi,

 

Im struggling with reading room history, from my Python script and keep getting:

{

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

 

Im not sure how to pass scope value in my request.

Tried various methods, none of them works.

My script

 

#!/usr/bin/env python


import jsonimport requests

headers = { 'Content-Type' : 'application/json' }

capabilities={ "hipchatApiConsumer": { "scopes": ["view_messages"] } }

params={ 'auth_token' : 'ABC, 'capabilities': capabilities }

req=requests.get('https://XXX.hipchat.com/v2/room/YYY/history/latest', headers=headers, params=params)

print req.content

 

Thanks

1 answer

0 votes

Hi, Lukasz!

Make sure the scope is enabled in the capabilities descriptor as explained in the following article:

Scopes

Let us know in case of any obstacles!

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...

30,431 views 0 7
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