When running below request nothing is returned
curl --request GET \ --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/downloads/{filename}' \ --header 'Authorization: Bearer <access_token>'
Access rights should be right since running
curl --request GET \ --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/downloads' \ --header 'Authorization: Bearer <access_token>'
returns JSON describing contents of downloads folder including the file I'm trying to fetch.
Also running request to
curl --request GET \ --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/src/master/README.md' \ --header 'Authorization: Bearer <access_token>'
returns repo's README.md as expected.
Any idea what's wrong on downloads folder GET request?
Hi @Janne Jussila,
Welcome to the community.
Would it be possible for you to try to use the CURL command below instead?
curl -s -L --request GET --header 'Authorization: Bearer <access_token>' https://api.bitbucket.org/2.0/repositories/workspace_id/repo_name/downloads/filename.txt --output filename.txt
Let me know how it goes.
Regards,
Mark C
Hi Mark,
I have tried with --output test.txt and also w/ -O. After these I do have file, but it's empty.
I can see from logs that no data is actually received.
OOPS.....
didn't notice that your proposed curl had -s -L at start...
now it works. Thank a lot,
-janne
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.