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

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,556,451
Community Members
 
Community Events
184
Community Groups

How to get all repositories that I can access via REST API 2.0 ?

Edited

I've been trying to get all the repository details that I can access. Some repositories are forked. Some are under different projects but shared with me and has admin access. Still, I'm only getting the repositories that are owned by me.

I'm using REST API 2.0 from this documentation: https://developer.atlassian.com/cloud/bitbucket/rest/intro/

 

The API endpoints I've tried are:

GET /2.0/repositories

GET /2.0/repositories/{workspace}

GET /2.0/workspaces/{workspace}/projects/{project_key}

GET /2.0/user/permissions/workspaces

1 answer

1 accepted

0 votes
Answer accepted
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Jun 22, 2022 • edited Jun 28, 2022

Hi @Jayashankar V R,

You can get all the workspaces your account has access to with the following endpoint:

GET /2.0/workspaces/

If you have access to repositories in e.g. 4 workspaces, that call should return these 4 workspaces.

Then, for each of these 4 workspaces, you can use

GET /2.0/repositories/{workspace}

where {workspace} replace with the workspace-id or the UUID for each of the 4 workspaces (the UUID should be enclosed in curly brackets).

Is this something that works for you?

If you're still having issues, could you please let me know:

  1. Which of these 2 endpoints you are having issues with?
    Does the first one not return all the workspaces?
    Or does the second one not return repos for a specific workspace?
  2. What kind of authentication are you using for the API calls?

Kind regards,
Theodora

Thank you @Theodora Boudale

It worked like a charm. The issue was, I was trying to get the workspace using its UUID and I only took the UUID part after excluding the curly brackets. Now it works fine.

Like Theodora Boudale likes this
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Jun 28, 2022

That's good to hear @Jayashankar V R, thank you for the update!

I edited my previous response to add that the UUID should be in curly brackets, as you correctly noticed.

Please feel free to reach out if you ever need anything else!

Kind regards,
Theodora

Like Jayashankar V R likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events