Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Adding group access to a repo through API (PUT 1.0/group-privileges)

Alexandre L
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 4, 2019

As per the documentation here, the PUT endpoint /1.0/group-privileges is supposedly still active.

However, no matter what I do, I get a "Your credentials lack one or more required privilege scopes." when doing the HTTP PUT request to add privilege(s).

 

Let's say my team name is "myteam", I'm trying to add read permission for the devops group as so:

$ curl --request PUT --user myuser:APPpassword https://api.bitbucket.org/1.0/group-privileges/myteam/helloworld/myteam/devops --data read

I've also tried using the team UUID in the group-owner part of the API, similar to what I see going on the wire when using the web interface:

$ curl --request PUT --user myuser:APPpassword https://api.bitbucket.org/1.0/group-privileges/myteam/helloworld/{110e8400-e29b-11d4-a716-446655440000}/devops --data read

In both cases, I get an HTTP 403 back with the message "Your credentials lack one or more required privilege scopes."

 

If I add the devops group though the web UI, I can successfully read the group permissions with the above URLs and using an HTTP GET.

Since I can add the permission through the web, and read them through the API, it leads me to believe that 1) my account has sufficient permissions and 2) the URL is good since I can read from it.

What am I doing wrong?

1 answer

1 accepted

1 vote
Answer accepted
Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 4, 2019

Hello @Alexandre L,

Thanks for reaching out.

The privilege scopes that error is referring to are set for the app password you use to authenticate the request (when you created an app password you specified which things it can access). The endpoint and method in question requires account write scope, so I believe a new app password with that scope included should fix the problem.

 create app password — Bitbucket 2019-11-05 09-05-27.png

Hope this helps.

Cheers,
Daniil

Alexandre L
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 5, 2019

Yes, of course. Thanks for pointing it out!

Like Daniil Penkin likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events