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

Bitbucket API for push file

Yash February 21, 2020

Hi,

I am looking Bitbucket API which can push file into Bitbucket Repo along with developer comment.

Is there any API available which can do this?

 

Thanks,

Yash

1 answer

0 votes
seanaty
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 21, 2020
Yash February 23, 2020

Hi,

Thanks, Now i am able to push file on bitbucket but unable to push file along with comments/message. I have used below sample API.

https://api.bitbucket.org/2.0/repositories/{0000-0000-0000-0000-0000}/etlsftpdataexporterservice/src?message=test_message

Thanks

seanaty
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 24, 2020

You can pass in `message` as either a GET or a POST parameter, as so:

curl -v https://api.bitbucket.org/2.0/repositories/atlassean/test_number_99/src \
  -u my_username:$MY_PASSWORD \
  -F /beatles/john.txt=john \
  -F /beatles/paul.txt=paul \
  -F /beatles/ringo.txt=ringo \
  -F /beatles/george.txt=george \
  -F files=beatles/john.txt \
  -F files=beatles/paul.txt \
  -F files=beatles/ringo.txt \
  -F files=beatles/george.txt \
  -F message="Ladies and gentlemen, the Beatles!"
Yash March 30, 2020

Hi,

I am unable to push code into sub directories of reposiry.

for e.g https://api.bitbucket.org/2.0/repositories/{0000-0000-0000-0000-0000}/etlsftpdataexporterservice/folder1/folder2

 

What should be format of api? Can you give me any example please.

 

Thanks

seanaty
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 30, 2020

In the example above, beatles/ is a directory. So paths are a part of the file name, not the URL

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Upcoming Bitbucket Events