0

I am trying to create a new project using Bitbucket API to this endpoint: http://api.bitbucket.org/2.0/workspaces/{My_Workspace}/projects by sending a POST request.

For headers I am passing: Authorization: Bearer + access token, Content-Type: application/json

For body I am passing: { "name": "test", "key": "TEST", "is_private": "true", "scm": "git" }

I return 200 but my return body is what you would expect to get if you were to send a GET request to get your existing projects.

How can I create a new project in Bitbucket using Bitbucket API? In my request am I doing something wrong?

  • What's your code to make the POST? – Randommm Mar 24 '23 at 07:14
  • @Randommm headers = { Authorization: "Bearer %s" % access_token, }; data = { name: projectName, key: projectKey.toUpperCase(), is_private: true, scm: "git", }; try { await axios.post( "http://api.bitbucket.org/2.0/workspaces/{my workspace}/projects", headers, JSON.stringify(data) ); } catch (error) { console.log(error); } – ceyForWork Mar 24 '23 at 17:20

0 Answers0