Retrieve the user's avatar via the REST API endpoints is returning a wrong avatar

Kim Aharfi September 8, 2022

I've being trying a lot of endpoint, and check the links.avatar.href on them

GET /2.0/user
GET /2.0/users/{selected_user}
GET /2.0/repositories/{workspace}/{repo_slug}/commit/{commit}
GET /2.0/repositories/{workspace}/{repo_slug}/commits

all of them return the default initial avatar image and not the updated atlassian image.
I have found that the site is using 

https://id.atlassian.com/gateway/api/me

to get the right avatar image, but Im doing it for bitbucket integration and my users only have a bitbucket authentication.

btw, this is just one blocker of many more I have on bitbucket api. (cannot get a user by mail or email, cannot get user account id from any request to get a user, cannot authenticate with bearer that used to worked, cloning repo sometime not include the previous push and take time to get update it), being succes to have a workaround for for every one of them but this one is a main blocker for me and my company

1 answer

0 votes
Syahrul
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 11, 2022

Hey @Kim Aharfi 

Welcome to the community.

By default, the endpoint follows the user Atlassian account configuration. If the user allows their profile to be public, then the avatar will be exposed in the API endpoint.

It's under Profile and visibility. You can configure who can see your profile picture (avatar). If it's configured public (anyone), it will return the user avatar in the Bitbucket API endpoint.

I hope this helps, and feel free to create new community questions for any of the blockers you have. We'd be happy to help.

Cheers,
Syahrul

Kim Aharfi September 14, 2022

thank you @Syahrul it is helpful!
another question I asked here is how can I get from name or email the uuid? I had to go throw 
GET /2.0/repositories/{workspace}/{repo_slug}/commits endpoint and search for the user?

Syahrul
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 15, 2022

Hey @Kim Aharfi 

I'm glad to hear that help!

I believe the following API endpoint should get the user name and UUID:

However, we currently do not expose user email addresses in our API endpoint, so I believe you can only get the user name and UUID at this moment.

Cheers,
Syahrul

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events