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

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

bitbucket archive REST API

Edited

According to the bitbucket archive API, there is a "path=" parameter which I believe can be used to get only the contents of a particular folder. But it does not seem to work.

For me the API call with and without "path=" gives the same output. (The whole repo contents as zip).

archive?format=zip&path=some%2Fpath%2Finside%2Frepo
archive?format=zip

**EDIT** There is no problem with the archive REST API. I was using wget from shell to test the API and since '&' is a special character for shell wget was not getting the path param at all

Is there a problem the way i use it? How is this "path=" param supposed to work?

I tested with "Atlassian Bitbucket v7.1.2"

Reference:

https://docs.atlassian.com/bitbucket-server/rest/7.1.2/bitbucket-rest.html

/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/archive

path

string

paths to include in the streamed archive; may be repeated to include multiple paths

 

1 answer

1 accepted

0 votes
Answer accepted

There is no problem with the archive REST API. I was using wget from shell to test the API and since '&' is a special character for shell wget was not getting the path param at all. Putting quotes around the url param for wget solved the issue for me.

wget -O test.zip "http://server.name/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/archive?format=zip&path=some%2Fpath%2Finside%2Frepo"

Suggest an answer

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

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

3,826 views 10 16
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