Forums

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

Unable to fetch email address using rest Api if setting profiles email id 'Only you and admins'

Abhishek Mayee
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!
April 13, 2022

Unable to fetch email address using rest Api if setting profiles email id 'Only you and admins'

Tried Api :

https://api.atlassian.com/user/<account_id> by this not able to get data

https://api.atlassian.com/api/3/user/email?accountId=<account_id> by this not able to get data

https://api.atlassian.com/ex/jira/<cloud_id>/rest/api/3/users by this we are able to get data but not email address if profile setting is Only you and admins

My understanding is that if setting says Only you and admins by using admin api token I should be able retrieve the email address.

Please help here ,  I had requirement to fetch user emails when there visibility is not publicjira_issue.png 

Thanks,

1 answer

0 votes
Andy Rusnak
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 15, 2022

Hi Abhishek, 

Welcome to the Atlassian Community!  And congrats on your first post, we are happy you are here! 

The email address API is restricted by the guidelines set here: 

https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603

as documented here: 

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-users/#api-rest-api-3-user-email-get

So if the user chooses to allow access to their email address (making it public) you can retrieve it via the API (as you have seen).  But if the user does not opt into providing the email address to the public, it isn't accessible via the API unless app is approved by Atlassian as noted in that first link, or leverages something like Oauth 2.0 (3LO) authentication and the user approves it through that process:

https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps/

If I have misunderstood your request please let me know, but I believe this is what you are running into based on the information you provided. 

Best, 

Andy 

Ashish Vats
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!
January 24, 2024

Hi Andy,

I am facing the same isssue. i have created an external app using Oauth 2.0 (3LO) authentication. I am making api requests for issues, tasks, etc, but if a person has set email address privacy to only you and admin, user details of each issue is returned without email address. 

I need admin's oauth to be able to fetch email Address of all other members as well. I am not sure, where to send my application.

Like Naseem Shaik likes this
Naseem Shaik
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!
January 25, 2024

@Andy Rusnak , we have the same issue. Please update us on how we can proceed here.

Suggest an answer

Log in or Sign up to answer