Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,560,579
Community Members
 
Community Events
185
Community Groups

Email API returns 401 error

Our app is dependent on getting user emails. We are fetching emails using user_account_id when customers install our App for the first time.

When we are calling following API to get user's email:

GET /rest/api/3/user/email?accountId={accountId}

We are getting 401 Unauthorized error with HTML response.
We are calling this API as documented here (https://developer.atlassian.com/cloud/jira/platform/rest/v3/?_ga=2.238660480.1263124937.1593510644-624183373.1586256627#api-rest-api-3-user-email-get)

We are creating JWT token and passing it in the header for authentication.

We have added ACCESS_EMAIL_ADDRESSES scope for our app.

For few users we are getting email address with 200 OK response. But for some users, we are getting 401 Unauthorised error.

Thanks for your help!

1 comment

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.
Jul 01, 2020

Did you get an Approval for the API by following the guideline here I believe without an Approval, you can only fetch users who's email visibility is set to anyone.

Hi @Prince Nyeche ,

Thanks for quick response.

This explains why this is happening intermittently. It will be very helpful if you can point me to this setting of email visibility in the JIRA, So I can reproduce this issue with my test workspace as well?

No we haven't applied for this approval yet. I will follow these guidelines and apply for the approval.

Regards!

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.
Jul 01, 2020

You will have to go here for your user under Contact set the email address to "Anyone" to allow visibility via API level.

Comment

Log in or Sign up to comment