Version 1

1.0 Response Formats

To use a REST API, your application makes an HTTP request and parses the response. By default, the response format is JSON. If you wish, you can use the '?format=' query string parameter to override this behavior and receive XML or YAML instead. For example, use following query string to receive output in YAML:

?format=yaml

You can also use the '?callback=' query string parameter with the name of a function to receive a response via JSONP. For example:

?callback=myJSfunc

A Bitbucket response always includes a response header containing one of the following response codes:

Code Description
200 OK Returned on success. For a GET method, the response contains an entity corresponding to the requested resource. For a POST method, the response contains the entity created.
201 CREATED Returned when a new resource instance is successfully created.
204 NO CONTENT Returned on successful deletion of a resource instance.
400 BAD REQUEST Returned if the caller submits a badly formed request. For example, the caller can receive this return if you forget a required parameter.
401 UNAUTHORIZED Returned if the call requires authentication and either the credentials provided failed or no credentials were provided.
403 FORBIDDEN

Returned if the caller attempts to make a call or modify a resource for which the caller is not authorized. The request was a valid request, the caller's authentication credentials succeeded but those credentials do not grant the caller permission to access the resource.

404 NOT FOUND Returned if the specified resource does not exist.

Depending on the call, a response may or may not include a body. Where a body is returned, the individual method documentation shows the expected structure of the returned data in JSON format.

Time zones

Any timestamp returned whose key contains "utc" is in Coordinated Universal Time. All other timestamps are in the  local time of Amsterdam . Amsterdam timestamps are now deprecated. If you're using them in your application, please switch to the UTC equivalents.

Was this helpful?

Thanks for your feedback!

Powered by Confluence and Scroll Viewport