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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

API call to repository details fails with UUID

Edited

GET calls to the endpoint /2.0/repositories/{workspace}/{repo_slug} fail when you use a UUID for the repo slug:

{"type": "error", "error": {"message": "The requested repository either does not exist or you do not have access. If you believe this repository exists and you have access, make sure you're authenticated."}}

The UUID is surrounded by braces as directed. The workspace is verified to be correct (the lowercase name works in other API calls). This fails whether or not a slash is used at the end of the URL. 

The repo UUID was found with a call to /2.0/repositories/{workspace}, with the same user. User access to the repo was verified.

Please advise. 

2 answers

1 accepted

1 vote
Answer accepted
seanaty
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Nov 22, 2021

It's likely you need to percent-encode the curly brackets {} which are %7B and %7D respectively.

Without encoding:

% curl 'https://api.bitbucket.org/2.0/repositories/atlassian/{5137f783-a12b-4958-a614-4a2af63fca20}' | jq . 
{
  "type": "error",
  "error": {
    "message": "The requested repository either does not exist or you do not have access. If you believe this repository exists and you have access, make sure you're authenticated."
  }
}

With encoding:

% curl 'https://api.bitbucket.org/2.0/repositories/atlassian/%7B5137f783-a12b-4958-a614-4a2af63fca20%7D' | jq . 

{
  "scm": "git",
  "website": "",
  "has_wiki": false,
  "uuid": "{5137f783-a12b-4958-a614-4a2af63fca20}",
  "fork_policy": "allow_forks",
  "full_name": "atlassian/atlassian-jwt-py",
  "name": "atlassian-jwt-py",
  "project": {

    "type": "project",
    "name": "Atlassian Connect",
    "key": "AC",
    "uuid": "{cc445f42-b2f8-4d69-bfd1-4e0047966e87}"
  },
  "language": "python",
  "created_on": "2016-06-29T15:49:21.227310+00:00",
  "mainbranch": {
    "type": "branch",
    "name": "master"
  },
  "workspace": {
    "slug": "atlassian",
    "type": "workspace",
    "name": "Atlassian",
    "uuid": "{02b941e3-cfaa-40f9-9a58-cec53e20bdc3}"
  },
  "has_issues": true,
  "updated_on": "2021-10-08T06:10:03.835470+00:00",
  "size": 688349,
  "type": "repository",
  "slug": "atlassian-jwt-py",
  "is_private": false,
  "description": "JWT (JSON Web Token) encoding & decoding library for Python 2 and 3. Extends pyjwt to include\r\nAtlassian's custom QSH (query string hash) claim."
}

@seanaty I replaced the brackets with their URL codes and everything works fine. Thanks for the help!

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

Hi all,

Here is an article I recently wrote that covers UUIDs, workspace names and repository slugs when working with Bitbucket:

Working with UUIDs and their curly brackets, workspace names or repository slugs in Bitbucket 


The file in the provided example (https://bitbucket.org/atlassian/forge-bitbucket-assign-pr-reviewer/src/main/src/index.js) shows how to fetch a repository with all its details given a workspace and repository UUID.

 

Hopefully, it provides some clarity.

Cheers,
Caterina

Suggest an answer

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

Atlassian Community Events