I am looking for the Rest API endpoint for this section of the repository configuration.
Thank you.
Hello Tim and welcome to the Community!
The Bitbucket cloud is going through a depreciation of the v1 REST API which is removing multiple endpoints and reducing some endpoints to only have the verb of GET, meaning you will no longer be able to manage permissions within Bitbucket cloud via the REST API.
As far as which permission endpoints you do have access to, you can review the following to see which endpoints allow you to view data; Bitbucket Cloud REST API | Permissions.
Additional information on the depreciation of the v1 API along with which v2 endpoints (if applicable) are replacing v1 endpoints can be found at Deprecation notice - Bitbucket Cloud REST API version 1 is deprecated effective 30 June 2018.
I hope this proves helpful and you’re able to find the v2 endpoints you need.
Regards,
Stephen Sifers
Hi I am getting the following error message "Error setting permissions for repository repo_name 403 - This endpoint does not support token-based authentication" I am not using token based authorization. This is the method in the python script I use:
def set_repository_permissions(username, password, destination_workspace, repo_name, source_repo_permissions):
destination_repo_permissions_url = f"https://api.bitbucket.org/2.0/workspaces/{destination_workspace}/permissions/repositories/{repo_name}"
print(destination_repo_permissions_url)
headers = {
"Content-Type": "application/json",
}
for permission in source_repo_permissions:
response = requests.post(destination_repo_permissions_url, auth=(username,password), json=permission, headers=headers)
if response.status_code != 201:
print(f"Error setting permissions for repository {repo_name}: {response.status_code} - {response.text}")
print(f"Permissions set for repository {repo_name}.")
Is there a reason it returns that particular error message
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.