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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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

Kule Dude I'm New Here Dec 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 I'm New Here Dec 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
Community showcase
Published in Bitbucket

Powering DevOps with Bitbucket Server & Data Center

Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster   ! While we’re all excited about the new improvements to Bitbucket ...

2,570 views 1 9
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