The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Response error-403 on trying to fetch Bitbucket workspace members list using API.

kompal.sithta
May 3, 2023

I have been trying to fetch the list of Bitbucket users using API present for workspace members.

The API I have been using so far is - https://developer.atlassian.com/cloud/bitbucket/rest/api-group-workspaces/#api-workspaces-workspace-hooks-get

On running the following code: I am getting the response error -403

 

import requests
import json


username = "username"
password = "password"

headers = {
  "Accept": "application/json",
 
}

response = requests.request(
   "GET",
   url,
   headers=headers,
   auth= (username,password)
)

print(response)

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
Fabio Racobaldo _Catworkx_
Community Champion
May 3, 2023

Hey @kompal.sithta ,

403 error means that  user is not an owner on the specified workspace

Fabio

Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 4, 2023

Hello @kompal.sithta ,

Just adding to Fabio's response, for the List users in a workspace  endpoint the 403 error can be returned in the following scenarios : 

  • You are not an Admin of the workspace in question
    • In order to get the list of members in a workspace through the API request, you need to be an Admin of the said workspace. 
  • The credentials you are using are lacking privileges :
    • To authenticate the API request, you will need to use the bitbucket account username along with an app password. For that particular API endpoint, the app password is required to have at least account:read permission selected.

Thank you, @kompal.sithta !

Patrik S

kompal.sithta
May 9, 2023

Thankyou @Patrik S  and @Fabio Racobaldo _Catworkx_  for your help

DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events