Why can't I do a GET on this rest endpoint using personal access token?

John Lawlor
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 15, 2018

I can retrieve the permissions for a project using this REST call:

curl -u "admin:password" -X GET https://bitbucket.company.com/rest/api/latest/projects/FW/permissions/users?permission=PROJECT_ADMIN

but if I do the same query using a personal access token:

 curl -H "Authorization: Bearer $PAT" -X GET https://bitbucket.company.com/rest/api/latest/projects/FW/permissions/users?permission=PROJECT_ADMIN

where $PAT is the value of the access token created for the 'admin' bit bucket user account, I get:

"You are not permitted to access this resource"

1 answer

1 accepted

1 vote
Answer accepted
Caterina Curti
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 17, 2018

Hi John,

Can you check that the access token for the 'admin' user has been set up with the "Admin" level for the Projects?

To clarify, access tokens can be set up with a lower permission level compared to the one available for the user. See the  Personal access tokens page for more details.

Cheers,

Caterina - Atlassian Support 

John Lawlor
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 19, 2018

Hi Caterina,

That was it thanks! :)

 

John

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events