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

The APIs in the "Users" section always return error

Ritesh.Hiremath
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!
May 14, 2024

I am trying to access the REST APIs that fetch the "Users" information. For Eg: https://api.bitbucket.org/2.0/user . This GET request always gives me an error - "

Token is invalid or not supported for this endpoint." The same issue when I try to fetch UUID of any user using the "Nickname" as parameter. Is this a permissions issue?

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 15, 2024

Hi Ritesh and welcome to the community!

The endpoint https://api.bitbucket.org/2.0/user will return the currently logged-in user based on the authentication method you are using. This will work if you use a username and app password, for example, but it will not work with a repository access token.

Can you please let me know which authentication method you are using for this API call from the ones listed on this page?

In case you use OAuth, which grant flow are you using to obtain an access token?

 

The same issue when I try to fetch UUID of any user using the "Nickname" as parameter.

The nickname is not unique and it can't be used with the following API endpoint:

You will need to use the UUID of the Bitbucket user enclosed in curly brackets. Please keep in mind you may need to escape the curly brackets, so use %7B instead of { and %7D instead of }.

For example, for a user with UUID 280g0f52-6832-9a31-f7er-488219b3e826 you would need to use

https://api.bitbucket.org/2.0/users/%7B280g0f52-6832-9a31-f7er-488219b3e826%7D

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events