Not getting user's emailAddress in user object in API response

Vivek Gupta April 30, 2021

Hi,

I am site admin and using REST API to fetch user information, as part of the response I see

- if user have set the visibility of emailAddress to 'Anyone' then response contain emailAddress.

- And if user have set visibility of emailAddress to 'Only you and admins' then API response does not contain emailAddress.

 

Why is it so? If calling API using org-admin/site-admins who have the visibility of emailAddress then it should get in the response.

 

Please help me to understand this and if there is any other way to get the emilAddress of user.

 

Note: Tried with org-admin/site-admin API token who has managed accounts.

1 answer

0 votes
Prince Nyeche
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 30, 2021

Hi @Vivek Gupta 

This is as a result of GDPR and that's the expected behaviour on Atlassian cloud. If you require access to an email, it is either you're using a connect app which in turn you must have made an official request to Atlassian for the email API otherwise via your standard REST request the emailAddress field will be hidden. Therefore the only way as you've mentioned to access it, is having the user declare their emailAddress to anyone on their profile visibility. Read the article provided on the link above to get more explanation.

Suggest an answer

Log in or Sign up to answer