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,301,216
Community Members
 
Community Events
165
Community Groups

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. 

1 answer

1 accepted

1 vote
Answer accepted
seanaty Atlassian Team 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!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
Community showcase
Published in Bitbucket

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

2,265 views 2 9
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you