Caseblocks Logo

Response Handling

Response Handling

The CaseBlocks API sticks to the principles of a [RESTful interface]( . It uses HTTP verbs (GET, POST, PUT, DELETE) to signal intent and the standard responses to signal results.
The following HTTP response codes can be expected from the API.

Common Headers

Each request to the API requires two HTTP reuqest headers, namely the Content-Type and the X-AUTH-TOKEN.

Throughout the REST API documentation you’ll see references to {headers}. The {headers} monniker

curl {headers}

is a short-hand for the following headers on a command line call to curl

curl -H 'X-AUTH_TOKEN: 94ZdThLd7WxZgCfghLSS' -H 'Content-Type: application/json'

200 – OK

All successful GET requests, for example retrieving a bucket of cases or user details, will return this response code and include the data typically JSON-serialized format.
The only exception to this rule is retrieving a document which will return a 200 status code and the document instead.

201 – Created

Any successful requests to create a resource, such as a case or bucket or document, will return a 201 status code. The response body will contain data in JSON-serialized format including any IDs generated on the server side such as a case ID.
Finally the Location HTTP response header will contain the URL for the newly created resource.


403 – Forbidden

The server has denied your request’s access to a particular resource, e.g. updating a case. For example, using your authentication token, you may only have read-only access to a particular case.
Please check that the external system’s User record on CaseBlocks is part of the relevant teams and should have access to the resource.

404 – Not Found

The server cannot find the resource you are looking for, for example a previously existing case has been deleted.
Please refresh your local state, for example reload the bucket of cases.

422 – Invalid request

The server cannot process your request because you have either provided incorrect or incomplete detail.
Please check the response body as it will often provide further detail on the error. For example:

    "message": "case_type_id was not specified"

500 – Not Found

The server encountered an internal error and cannot continue processing your request.
Please check the response body for further detail and contact [[email protected]](mailto:[email protected]) for further help. For example:

    "message": "SLA service unavailable"