Bitbucket Cloud REST API: Error when trying to download a single file from remote repo. Edited

 I do not have a local repo on my machine and I want to download a single file from remote repo from a specific branch. Think of this as an equivalent of git archive command. 

I am trying to achieve this using the following:

https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/downloads/%7Bfilename%7D

I have added my PUB key on the bitbucket account under SSH key. If I run the following command I get Forbidden error on the terminal.

curl -s -L https://api.bitbucket.org/2.0/repositories/apurva_sharma_repo/testingapi/downloads/testing.txt 

If I use Postman to make this call with basic auth in header I get 404 Not Found and response body as 

{
    "type": "error",
     "error": {
                 "message": "testing.txt"
      }
}

0 answers

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 06, 2018 in Bitbucket

Upgrade Best Practices

Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...

194 views 3 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you