Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

path problem when converting from REST API 1.0 to 2.0

Big Badger
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 28, 2019

We are converting from rest api v1.0 to 2.0 and want to download a xml single file in our build scrips.

basically we keep getting:

{"type": "error", "error": {"message": "Resource not found", "detail": "There is no API hosted at this URL.\n\n

to test we are using curl. it looks like the below. Note that we add "/raw/tip/" to the path (it worked in api 1.0 - not sure why)
the acutal path via browser is like:

https://bitbucket.org/user-name/my-repo/my-folder/file-to-download.xml


curl -v -u user-email:password https://api.bitbucket.org/2.0/repositories/%7Bmy-uuid%7D/my-repo/raw/tip/my-folder/file-to-download.xml -o test


Related info ----

I found the uuid via the command below and used the uuid at the start of the output as in: "scm": "git", "website": "", "has_wiki": false, "uuid": "{my-uuid}"

curl -u user-email:password https://api.bitbucket.org/2.0/repositories/1team/moxie

output -

"scm": "git", "website": "", "has_wiki": false, "uuid": "{my-uuid}" ---- used this first uuid

I believe I have the correct UUID as this works:

curl -u user-email:password https://api.bitbucket.org/2.0/repositories/%7B%7D/%7my-uuid%7D


We currently have no teams defined for this repository. Are teams a prereq to using the api 2.0 call?

Do I need to add that /raw/tip/ to the path? (doesn't seem to work with or without)

Should I be using some other approach to get a single file?

Many thanks!

1 answer

0 votes
Eric Henry
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 1, 2019

@Big Badger ,

Not all APIs were named the same between 1.0 and 2.0. I think you're looking for the `src` API:

https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/src/%7Bnode%7D/%7Bpath%7D

Eric

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events