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 Aug 21, 2018 in Bitbucket

Branch Management with Bitbucket

As a project manager, I have discovered that different developers want to bring their previous branching method with them when they join the team. Some developers are used to performing individual wo...

1,179 views 8 10
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