You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
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.