Forums

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

How I can GET a group on a repository by API ?

phongtd September 28, 2021

I follow this document: https://support.atlassian.com/bitbucket-cloud/docs/group-privileges-endpoint/ and GET a group on a repository (I have full access to bitbucket API), but I have a problem when I insert group_owner to this API URL : 
https://api.bitbucket.org/1.0/group-privileges/{workspace_id}/{repo_slug}/{group_owner}/{group_slug}

After I GET (I use PostMan for call API), the response always I received result: 400 Bad request and Group is not owned by the workspace.

Please help me where I find group_owner and what I need to insert.

Warm Regards.

 

2 answers

1 accepted

1 vote
Answer accepted
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 29, 2021

Hi @phongtd and welcome to the community.

The {group_owner} should be the Bitbucket UUID of the account/workspace that owns this group.

You can find the info the following way:

If you make a call to

https://api.bitbucket.org/1.0/group-privileges/{workspace_id}/{repo_slug}

you will get info for all groups with access to this repo. For each group in the output of the above call, you will see the following fields:

"group": {
"owner": {
"display_name": "some-name",
"uuid": "{7914a899-371g-0968-t2w3-6317b0936b6e}",
.........


The uuid above is what you need to use for {group_owner} in the call you want to make. You may also need to encode the curly brackets around the UUID, in this case { should be replaced with %7B and } should be replaced with %7D

An example URL using the UUID I gave above would be

https://api.bitbucket.org/1.0/group-privileges/my-workspace/test-repo/%7B7914a899-371g-0968-t2w3-6317b0936b6e%7D/developers

I would also suggest testing the call with curl as well.

Please feel free to let me know if this works and if you have any questions.

Kind regards,
Theodora

phongtd September 29, 2021

Hi @Theodora Boudale

I have rechecked, it works well with your answer, and when I input lower-key in {group_slug}.

Thanks for helping me, I was able to use it. :D

Warm Regards.
Like # people like this
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 1, 2021

Hi @phongtd,

Thank you for the update and you are very welcome, I'm glad to have helped!

Kind regards,
Theodora

Like phongtd likes this
0 votes
Ulrich Kuhnhardt _IzymesCo_
Atlassian Partner
September 28, 2021

Hi - even though I don't know the answer I suggest you also post your question in the bitbucket cloud developer forum https://community.developer.atlassian.com/c/bitbucket-development/bitbucket-cloud/13

Best, Ulrich

www.izymes.com

phongtd September 29, 2021

Hi @Ulrich Kuhnhardt _IzymesCo_ , 

Thanks for suggesting me.

Warm Regards.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events