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

0 votes
Answer accepted
Fabio Racobaldo _Herzum_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
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 _Herzum_  for your help

Suggest an answer

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

Atlassian Community Events