Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to get UUID for a specific user

Sruthi_Nadimpally October 2, 2023

Hi team, 

I'm trying to automate pull request creation (through jenkins job) using curl command but unable to retrieve the UUID of a specific user. 

I've tried multiple queries (which include) to get the UUID but none seems to worK:

[jenkins@linuxslave-jenkins demandware]$ curl -X GET --user "REDACTED:xxxxxM" https://api.bitbucket.org/2.0/teams?role=members
{"type": "error", "error": {"message": "Resource not found", "detail": "There is no API hosted at this URL.\n\nFor information about our API's, please refer to the documentation
[jenkins@linuxslave-jenkins demandware]$ curl -X GET -H "Content-Type: application/json" -u "REDACTED:9Fxxxxx" "https://api.bitbucket.org/2.0/users/REDACTED"
{"type": "error", "error": {"message": "REDACTED"}}[jenkins@linuxslave-jenkins demandware]$
[jenkins@linuxslave-jenkins demandware]$
[jenkins@linuxslave-jenkins demandware]$ curl -X GET --user "REDACTED:xxxxx" https://api.bitbucket.org/2.0/teams?role=member
{"type": "error", "error": {"message": "Resource not found", "detail": "There is no API hosted at this URL.\n\nFor information about our API's, please refer to the documentation at: https://developer.atlassian.com/bitbucket/api/2/reference/"}}[jenkins@linuxslave-jenkins demandware]$


Can you please help me in providing the right query to get the UUID of users in a workspace?

2 answers

0 votes
Caterina Curti
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 3, 2023

Hi @Sruthi_Nadimpally,

I recently wrote this guide: https://community.atlassian.com/t5/Bitbucket-articles/Retrieve-the-Atlassian-Account-ID-AAID-in-bitbucket-org/ba-p/2471787

 

When working with the Bitbucket REST APIs, I would recommend using the Atlassian Account IDs (AAID) instead of UUIDs.

 

Cheers,
Caterina

0 votes
Ben
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 2, 2023

Hi Sruthi,

The teams endpoint has been deprecated in favor of the workspaces endpoint, therefore any calls to the teams API will fail as it is non-existent.

The correct command would be as follows:

curl -X GET --user username:AppPassword https://api.bitbucket.org/2.0/workspaces/workspaceID/members

NOTE: You will need to replace username/AppPassword/workspaceID with actual values.

Hope this helps.

Cheers!

- Ben (Bitbucket Cloud Support)

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events