I'm trying to create a project using REST API. Every time I'm getting internal server error like this:
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, key, is_private and description, so I'll have to guess... you haven't tested that.
name
key
is_private
description
Hi @[deleted],
I've tried only required parameters and still getting the same. I've updated the URL in question as well.
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:
https://developer.atlassian.com/cloud/bitbucket/rest/api-group-projects/#api-workspaces-workspace-projects-post
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
It looks like you're new here. Sign in or register to get started.