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

bitbucket archive REST API

Kule Dude December 17, 2020

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
Kule Dude December 18, 2020

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
AUG Leaders

Atlassian Community Events