Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,298,560
Community Members
 
Community Events
165
Community Groups

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

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

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

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

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

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

Hi @Ulrich Kuhnhardt _IzymesCo_ , 

Thanks for suggesting me.

Warm Regards.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

2,231 views 2 9
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