Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
Level
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How can I get the full list of repositories with REST API Edited

I can get the list of my repositories or the repositories of the groups I belong to, with:

curl https://api.bitbucket.org/2.0/repositories/username/

curl https://api.bitbucket.org/2.0/repositories/group1/

curl https://api.bitbucket.org/2.0/repositories/group2/

But, how can I get the full list of the repositories I have access permission?

Thank you.

  Nello

2 answers

2 accepted

1 vote
Answer accepted

Hello @nellinux,

Welcome to the Community!

Here's the endpoint that returns exactly what you're after:

https://api.bitbucket.org/2.0/user/permissions/repositories

Here's the relevant API documentation page.

Hope this helps. Let me know if you have any questions.

Cheers,
Daniil

0 votes
Answer accepted

While I admit Atlassian would do great on having an API call that just simply generates a list no matter the size but nooo they had to make it difficult. :')

Your best bet is to use the API call "/repositories/{your_team}/pagelen=25". This will return a paginated result. Good thing about it, is that the response comes with a property "Next". Which holds the url of the API call to get the next page of results.

So the steps you need to take are:

1) POST /repositories/{your_team}/pagelen=25

2) Parse the JSON response. This looks like:

{

"page": 1,

"pagelen": 25,

"next": "/repositories/{your_team}/pagelen=25&startsAt=25"

"previous": "...",

"values":  []

}

3) Send the POST request with as url the value of the above "next" property

4) Repeat steps until the values.length < pagelen

Thank you :-)

Suggest an answer

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

Calling any interview participants for Bitbucket Data Center

Hi everyone,  We are looking to learn more about development teams’ workflows and pain points, especially around DevOps, integrations, administration, scale, security, and the related challeng...

525 views 6 4
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