Forums

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

How to retrieve user's "Based In" information from profile

Filipe Sousa
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!
November 11, 2022

I can retreive the user email, display name, active, timezone, locale, avatar without any problem, but I can't access the "Based In" information, from the user profile, even when its set visible to anyone.

2022-11-11 10_30_23-Atlassian account.png

I have tried :

/rest/api/3/user?accountId=${accountid}

/rest/api/3/user/search?accountId=${accountid}

 

I am using an admin account to make the api requests.

2 answers

1 accepted

2 votes
Answer accepted
Alex Koxaras -Relational-
Community Champion
November 12, 2022

Hi @Filipe Sousa 

Using the API request you do, will not get you far since this specific API is domain related (I mean is only for you site). I would explore to see if this https://developer.atlassian.com/cloud/admin/user-management/rest/api-group-users/#api-users-account-id-manage-profile-get suit your needs, and most likely this is the one you need.

curl --request GET \
--url 'https://api.atlassian.com/users/{account_id}/manage/profile' \
--header 'Authorization: Bearer <access_token>' \
--header 'Accept: application/json'

The only catch is that you "You have permission to manage the user. The profile data is returned."

1 vote
Joseph Chung Yin
Community Champion
November 11, 2022

@Filipe Sousa -

Welcome to the community.  Although in the Profile UI is named "Based in", it is actually named as "location" attribute in the JSON body based on my knowledge.

Hope this helps

Best, Joseph Chung Yin

Jira/JSM Functional Lead, Global Infrastructure Applications Team

Viasat Inc.

Filipe Sousa
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!
November 11, 2022

Got that information with browser developer tools.

extended_fields.png

But in postman when calling these endpoints we don't get the info from the extended_profile

https://{domain}.atlassian.net/rest/api/3/user/search?query={user}

or

https://{domain}.atlassian.net/rest/api/3/user?accountId={accountId}

When getting user info event when location is set visible to anyone, we don't have access to that field in the api response

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events