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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to build commit statuses with API 2.0?

Currently, I am trying to create a build status for a pull request commit through Bitbucket's new API 2.0

However, the documentation for this API call is confusing as the request body is the exact same as the response body (like it is calling for the uuid of the commit status I have yet to create).

So, I instead used the old request structure from API 1.0:

	"key": "<build-key>",
	"name": "<build-name>",
	"url": "<build-url>",
	"description": "<build-description>"

I send this request (with the proper authorization and all) to:<my-workspace>/<my-pullrequest>/commit/<commit-sha>/statuses/build

with request a request body structured:

"state": "INPROGRESS",
"key": "build",
"name": "Hello World",
"url": "https//",
"description": "YAY!"

...and am met by this:

"type": "error",
       "error": {
              "message": "Bad request"

So it is apparent that the old request body is either outdated, I am miss reading the current API documentation, or the current API documentation needs to be updated.

Has anybody else correctly built a commit status with the new API? If so, how was the request built?

1 answer

0 votes

Hello @Will Baizer,

Thanks for reaching out.

The documentation is indeed confusing there, we'll look into improving it.

The request body you posted looks good to me. I think you didn't specify Content-Type: application/json header, can you confirm this?

Hope this helps.


Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

Powering DevOps with Bitbucket Server & Data Center

Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster   ! While we’re all excited about the new improvements to Bitbucket ...

1,892 views 0 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you