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,552,518
Community Members
 
Community Events
184
Community Groups

bitbucket API sending text file to bitbucket

Hi all,

I have a django application which has the function of pulling files from s3 bucket using boto3 and pushing it to bitbucket. I understand that theres a post api which allows me to send files into bitbucket. this is an example of the post api

$ curl https://api.bitbucket.org/2.0/repositories/username/slug/src \ -F /repo/path/to/word.txt=@word.txt

for the part after the @, what do i include after it since the file retrieved from s3 is in a json format

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Aug 24, 2022

Hi @cnshum_2019 and welcome to the community.

In the -F argument, the part after @ should be the path to the file and the name of the file on your machine (the one where you have downloaded this file and where you are executing the curl command).

If the file on your machine is named myFile.json and it exists in the current working directory (where the curl command is running), you can simply put myFile.json


The part /repo/path/to/word.txt is the path of the directory in the repo where you want to upload the file, and also the name you want this file to have once uploaded to the repo.

If you want to commit the file to the root of the repo, and you want to name it myFile3.json, then you simply put myFile3.json instead of /repo/path/to/word.txt. You could also keep the same name as locally.

The following call will commit your local file named myFile.json in the repo, and the file will have the name myFile3.json once uploaded to the repo.

curl https://api.bitbucket.org/2.0/repositories/username/slug/src -F myFile3.json=@myFile.json

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events