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

How can I get a Bitbucket user ID by bitbucket API

hi-oka October 8, 2019

Hello,

I want get my team menber's user ID.

Because it cannot be confirmed from the screen.

I got user information with API(https://api.bitbucket.org/2.0/teams/xxxxx/members)
but nickname is Japanese Charactor It doesn't seem to be a user ID.

Doesn't "nickname" display user ID?

I can't see them in any field.
Please tell me can get team member's UserID.

I also get another API(https://api.bitbucket.org/2.0/users/xxxxx)

but I got same result.

 

2 answers

1 accepted

1 vote
Answer accepted
Caterina Curti
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 4, 2023

Hi all,
The unique identifier that you want to use is the Atlassian Account ID (also known as AAID). 

 

The Atlassian Account ID is accepted in the REST API requests and available in the response as the account_id field.

 

Here is an article where I explain how to retrieve the AAID: Retrieve the Atlassian Account ID (AAID) in bitbucket.org

The most common REST API endpoint to retrieve the account IDs of users is the members endpoint. It returns the account_id of all users belonging to a workspace when calling the https://api.bitbucket.org/2.0/workspaces/{workspace}/members endpoint. 

 

While the UUID was the standard a few years ago, these days the Atlassian Account ID is the preferred, recommended and future proof option as a unique identifier for users.

 

Caterina

2 votes
Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 8, 2019

Hello @hi-oka,

2023 Update

Please refer to @Caterina Curti's reply. The preferred unique user identifier is the Atlassian Account ID (also known as AAID).

 


 

The right identifier of a user (and many other entities in Bitbucket REST API) is the uuid field. Unlike nickname, which can change over time, uuid always remains same for the given user.

For instance, request to this URL will return display names of team members along with their uuids and pagination parameters required to fetch all pages of the response:

https://api.bitbucket.org/2.0/teams/xxxx/members?fields=values.display_name,values.uuid,page,next

Note that uuid contains curly braces and should be used like that anywhere in the REST API or URLs.

Hope this helps. Let me know if you have any questions.

Cheers,
Daniil

hi-oka October 9, 2019

Hello Daniil,

Thank you for  your answer.

I understood that uuid is identifier.

But I have noticed.

This API is get team members, does not retrieve team plan-users.

Is there an API to get a list of plan-users? (URL :https://bitbucket.org/account/user/(ID)/plan-users/)

Kota Sreenivasa Shravana Kumar December 3, 2020

what is xxxx in the below call? 

 

https://api.bitbucket.org/2.0/teams/xxxx/members?fields=values.display_name,values.uuid,page,next
Sarah Dwyer January 8, 2021

That'd be your workspace name, so: https://bitbucket.org/xxxxxx/workspace/settings

Kim Aharfi September 14, 2022

@Sarah Dwyer @Daniil Penkin  this endpoint show only the display name and not the bitbucket user name, how can I get it for username? or even email?

Like Pedro Roman likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events