Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,461,858
Community Members
 
Community Events
176
Community Groups

I want to download my private repository from bitbucket using api calls from my flutter app.

I want to download my private repository from bitbucket using API calls from my flutter code(DART), how can I download?

1 answer

1 accepted

1 vote
Answer accepted
Mark C Atlassian Team Dec 12, 2022

Hi @Devansh Mathur,

Welcome to the community.

Unfortunately, we don't have an official API endpoint for you to use to download a repository.

Right now, we have the following workarounds:

To download or get a specific file from your repository, you can use this API endpoint. - Get file or directory contents

To download a repository as a compressed folder, you can use the endpoint below which is also used in your repository Downloads section.
Please do note that it only downloads specific revisions from your repository (e.g. the latest commit or tags or branches)

curl -u bbusername:app_password https://bitbucket.org/{workspace}{repo}/get/master.tar.gz -o master.tar.gz

Hope it helps and do let me know if you have further questions.

Regards,
Mark C

Hello @Mark C 

Thank you for the answer.

I already know about this API to download files I was only searching for an API to download the repository. 

And I got the API for which I was looking.

Regards,

Devansh

Hello @Mark C 

Can you provide the documentation for this curl.

curl -u bbusername:app_password https://bitbucket.org/{workspace}{repo}/get/master.tar.gz -o master.tar.gz

I am not able to hit API through my flutter code. 

Hello @Mark C 

And please do let me know the response type or the encoding technique used in the response of this API.

I am not able to process the data received from this API using my flutter code.

 

I have used both Dio and HTTP packages in flutter for API call and an exception is received that is 

"XMLHttpRequest error"

I have tried this link https://stackoverflow.com/questions/65630743/how-to-solve-flutter-web-api-cors-error-only-with-dart-code/66879350#66879350

it says to disable the security.

and after disabling the security the API gives me the response.

so is there any way to hit the API without disabling the security?

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events