Missed Team ’24? Catch up on announcements here.

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

how can i query the bitbucket rest api for all repositories within a project?

i.rutjes March 25, 2021

Hello,


I'm working on a system that collects a file{s) from the repo for our package manager.
There is only a problem, in that the bitbucket account, there are a lot of repositories.

So I was playing around with the query functionality of the API.
every repository has a project key, so I thought I could do this:

repositories/{WorkSpace}?project.key={ProjectKey}

Sadly this doesn't work. Is this feature supported?

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 26, 2021

Hi @i.rutjes and welcome to the community.

This should work, but I think you're missing the q= part after the question mark in the URL. The URL should be

https://api.bitbucket.org/2.0/repositories/my-workspace?q=project.key="TEST"

You may also need to URL encode the characters = and ", e.g. from my terminal I had to do the following:

curl -u username:app-password https://api.bitbucket.org/2.0/repositories/my-workspace?q=project.key+%3D+%22TEST%22

Is this something that works for you?

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events