Access rest api for admin.atlassian.com

Scott Piferrer
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 14, 2022

Hi, 

 

I am trying to query the following API: admin.atlassian.com/gateway/api/adminhub/um/site/{org-id}/users with an admin api key but I am getting the following error back, even though I am site owner/global admin: 

 401,"message":"Unauthorized.

I can access this rest api in the browser, or using a cloud.session.token, but am trying to move away from that. 

i am passing through the bearer token in my code as follows: 

headers = {
    "Accept""application/json",
    "Authorization""Bearer ioashd8a7ysdlda" #not a real token
}

Any ideas on what I need to be able to get the users query back? 

I am trying to obtain the following data back, whuch comes from suing the cloud-session-token: 

 "platformRole"null,

        "id""",

        "email""",

        "displayName""",

        "active",

        "hasVerifiedEmail",

        "picture"""

        "activeStatus""",

        "nickname""",

        "title"null,

        "timezone"null,

        "location"null,

        "companyName"null,

        "department"null,

        "presence""2022-01-26T17:58:04.134421Z",

        "created""2021-12-17T09:10:10.850Z",

        "invitationStatus"null,

        "system"false,

        "orgAdmin"false,

        "siteAdmin"false,

        "sysAdmin"false,

        "trustedUser"false,

        "presenceUnavailable"false,

        "managedStatus": {

            "managed"false,

            "owner"null

2 answers

0 votes
Ivad Yves Habimana April 21, 2024

Same issue here. Any solutions?

 

0 votes
louis_beguin
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!
May 18, 2022

Hi Scott, 

 

I am facing the same issue but making this work with cloud.session.token is ok in my use-case.

 

Could you please tell me how you managed to make it work ? 

 

Thanks,

 

Louis

Quyen Hoang September 29, 2022

Hi, 
I'm trying to use this API too. How can I get cloud.session.token to use this API? Is there any documentation about this?

Thank you!

Chris Delgado December 11, 2023

bump

Like Rob Jagger likes this

Suggest an answer

Log in or Sign up to answer