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,459,882
Community Members
 
Community Events
176
Community Groups

Not able to create a project using rest api

Edited

I'm trying to create a project using REST API. Every time I'm getting internal server error like this:

 

{
    "type""error",
    "error": {
        "message""Something went wrong",
        "id""0bd3a5f302e843fda412d6416a17beef"
    }
}
EDIT: URL https://api.bitbucket.org/2.0/workspaces/<workspace>/projects

2 answers

0 votes
Caroline R Atlassian Team Mar 17, 2022

Hi, Aman, thank you for reaching out to Atlassian Community.

I tested this on my side and was able to create a project using the following API: 

Here is an example that you can follow, you just need to inform your workspace ID, the project name, and the key you would like to create:

curl --request POST -u username:AppPassword \
--url 'https://api.bitbucket.org/2.0/workspaces/{workspace_ID}/projects' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"key": "{inform_a_key}",
"name": "{project_name}",
"is_private": true
}'

Please let me know how it goes and feel free to share any additional questions or concerns regarding this case.

Kind regards,
Caroline 

Our annual user conference, Team ’22 is back! Join us in Las Vegas starting April 5th or attend digitally on April 6th. Register now: https://events.atlassian.com/team22

Hello @Aman Tur 

You've probably submitted an invalid request.

The payload is from the example:

 

{
"name": "CloudX",
"key": "CEX",
"description": "This Project is for the CloudX.",
"is_private": true,
"has_publicly_visible_repos": false,
"type": "project",
"uuid": "c35b960d-3c0e-467b-81d4-b43368beac96",
"links": {
"avatar": {
"href": "https://.../default.png"
}
}
}

You haven't provided any information as to which Bitbucket REST API endpoint you're sending that request to or the method, so I'll have to guess.... you're sending a POST request to:

/2.0/workspaces/{workspace}/projects

You haven't advised if the request works if you omit all the un-required parameters and just define the required ones like name, keyis_private and description, so I'll have to guess... you haven't tested that.

Hi @David Bakkers,

I've tried only required parameters and still getting the same. I've updated the URL in question as well.

I'm able to create projects in one of the workspaces of my Bitbucket Cloud account using that REST API endpoint with only those required parameters without any errors.

Nobody else seems to be reporting any problems with Bitbucket Cloud's REST API, so if it's affecting just you and just that REST API endpoint and no others, and you've tried all the obvious usual things like:

  • Testing with another OAuth key / token
  • Checking with another method (different dev tool / language)
  • Checking with a test tool like Postman

...and the error persists, I suggest you raise a support request with Atlassian.

Good luck.

I'm using Postman already, but using another access key does look promising.

Like Stefan Salzl likes this

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events