Hi!
Ive been trying to use the admin rest api to get all user (https://developer.atlassian.com/cloud/admin/user-provisioning/rest/api-group-users/#api-scim-directory-directoryid-users-get)
Using python I am constantly running into a 403 return code.
I am an org admin, created an API key via the admin interface, which returns the API key and the directoryId.
The tenant has users being provisioned via EntraID
I am using the following code:
directory_id= "xxx"
api_key= "xxx"
url = f"https://api.atlassian.com/scim/directory/{directory_id}/Users"
headers = {
"Accept": "application/json",
"Authorization": f"Bearer {api_key}"
}
response = requests.request(
"GET",
url,
headers=headers
)
I am constantly getting the following response:
{
"detail": "Not authorized to access: /api/scim/directory/xxx/Users",
"schemas": [
"urn:ietf:params:scim:api:messages:2.0:Error"
],
"scimType": "invalidValue",
"status": "403"
}
Ive also tried Basic authentication by base64 encoding my email and the api key, which then returns a 401 'Not authorized" instead.
Any ideas what might be the issue here?
Thanks a lot