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,369,852
Community Members
 
Community Events
168
Community Groups

How can I get a Bitbucket user ID by bitbucket API

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.

 

1 answer

1 accepted

1 vote
Answer accepted

Hello @hi-oka,

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

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/)

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 @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?

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events