Forums

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

Unable to get the user and group permissions of the repository using REST API

venkatesh.monangi
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!
March 23, 2023

I am working on the Bitbucket repository (Cloud) for a couple of actions to perform on it. Like getting the repository details and applying some changes to existing repositories based on conditions. In our workspace, we have around 2000+ repositories and thus we need some automation to do some changes.

Currently, I am able to fetch details like
- getting members
- getting repositories
- getting branches and it's restrictions
- etc...
Likewise, I am trying to get the `user and group permissions` of each repository. To achieve the same, I have referred bitbucket rest api doc and I found
https://developer.atlassian.com/server/bitbucket/rest/v807/api-group-permission-management/#api-api-latest-projects-projectkey-repos-repositoryslug-permissions-groups-get.
But, with that it's returning `404` error even though I am using admin-user and the repository exists.

Here is the example, I am getting branch restrictions with the below RESTAPI successfully but not for `user and group permissions`.

`curl -u {user}:{password} https://api.bitbucket.org/2.0/repositories/{workspace}/{repo-slug}/branch-restrictions/`

I am able to fetch the branch restrictions of the repository.
But, when I hit below REST API - Getting a 404 error

`curl -u {user}:{password} https://api.bitbucket.org/2.0/repositories/{workspace}/{repo-slug}/permissions/groups/`

`{"type": "error", "error": {"message": "Resource not found", "detail": "There is no API hosted at this URL.\n\nFor information about our API's, please refer to the documentation at: https://developer.atlassian.com/bitbucket/api/2/reference/"}}% `

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events