curl command downloading false zip file from bitbucket after 1 March update from Atlassian.

Vivek
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!
March 16, 2022

Hi guys, 

We have been using (Linux) CURL command to download ZIP file from bitbucket "downloads" section and its working completely fine. But its not working now. We haven't changed anything except account password.

we are using URL structure as below: 

sudo curl -O -L https://bitbucket.org/<ORGANISATION>/<REPO>/downloads/Artifacts.zip -u 'username:AppPassword'

But we are getting this issue: (Actually when we hit above command this file gets downloaded)

Capture.PNG

By using -v parameter in above command, we are getting details as below:

Capture2.PNG

Also, we have tried creating new app password and added that in above command in user authentication. but its not working.

NOTE: we are aware about new authentication changes made by Atlassian, that we must use app password for authentication and we are using app password for it (not account password) but somehow those changes are not working for us.

Can anyone please tell us what we are doing wrong? because it was working before

1 answer

1 accepted

1 vote
Answer accepted
Ben
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 16, 2022

G'day Vivek!

With the change from basic GIT username/password over to AppPassword, you will now need to make use of our /2.0/repositories API endpoint with your AppPassword.
Performing API commands on direct links to files within a repository will cause an authentication issue as the deprecated authentication method is used by default.

For example, the below command will work for your purposes:

curl -X GET -O -L \

  --url https://api.bitbucket.org/2.0/repositories/<ORGANISATION>/<REPO>/downloads/Artifacts.zip \

  --header 'Authorization: Basic AppPasswordHere'

 

Hope this helps.

Cheers!

- Ben (Bitbucket Cloud Support)

Vivek
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!
March 16, 2022

Thank you so much....It Worked!!

Ben
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 16, 2022

Hey Vivek,

Not a problem, I'm glad to know that has helped you out!

Cheers

- Ben (Bitbucket Cloud Support)

TechSolutions.admin May 3, 2024

The command has worked for me as well ... but the Artifacts.zip file is empty.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events