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

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

Apurva Sharma August 4, 2017

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

Atlassian Community Events