The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to create project in bit bucket using bit bucket REST API?

Vaasanthi
January 12, 2018

We are trying to create projects in bit bucket automatically.

Tried the following  options and it didn't work. can some one guide?

1. curl -k -X POST --user UID:PWD "https://bitbucket.example.com/context/rest/api/1.0/projects" -d "name=vptest"

2. curl -X POST -v -u UID:PWD "https://bitbucket.example.com/projects" -H "Content-Type: application/json" -d '{"scm": "git", "is_private": "true", "fork_policy": "no_public_forks"}'

3. curl-k -X POST --user "UID:PWD" https://bitbucket.example.com/rest/api/1.0/projects?name='test_project'

 

 

3 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
Edwin Kyalangalilwa
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
January 13, 2018

Hi Vaasanthi,

You can use this python api.

https://pypi.python.org/pypi/stashy/0.3

pip install stashy
import stashy

bitbucket = stashy.connect(host, user, pass)
bitbucket.projects.create("TEST", "Test")
1 vote
Prakash Ganeshan
June 18, 2019

I am able to create a project in Bibucket server using this API:

 

curl -D- -u username:Password -d "{ \"key\": \"PRA\", \"name\": \"My project\", \"description\": \"My First project through API\" }" -H "C
ontent-Type: application/json" http://servername:7990/rest/api/1.0/projects

Vvp Vp
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 17, 2021

I have a similar request

 

curl -D- -u username:Password -d "{ \"key\": \"PRA\", \"name\": \"My project VVP\", \"description\": \"My First project through API\" }" -H "Content-Type: application/json" https://bitbucketexample.com/rest/api/1.0/projects

*https://bitbucketexample.com replaced with my URL.

 

 

but i got an error

{"errors":[{"context":null,"message":"You are not permitted to access this resource","exceptionName":"com.atlassian.bitbucket.AuthorisationException"}]

 

I am a admin, so what is missing here.

0 votes
Rashmi
May 1, 2019

Hi Vasanthi,

 

Were you able to create project using API?

TAGS
AUG Leaders

Atlassian Community Events