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!
Not all APIs were named the same between 1.0 and 2.0. I think you're looking for the `src` API:
Eric
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.