Client errors

When a request requires the client to send a request body, there are four possible types of client error.

1.

Sending a request with no content (body) when it’s required will result in a 400 Bad Request response.

   HTTP/1.1 400 Bad Request
   {
     "message": "missing",
     "status": "bad request"
   }

2.

Sending content which cannot be parsed as JSON will result in a 400 Bad Request response. Sending the wrong type of JSON value will result in the same response (e.g. sending a string when an object is expected).

   HTTP/1.1 400 Bad Request
   {
     "message": "invalid",
     "status": "bad request"
   }

3.

Sending invalid fields will result in a 422 Unprocessable Entity response.

   HTTP/1.1 422 Unprocessable Entity
   {
     "errors": [
       {
         "field": "name",
         "reason": "missing"
       },
       {
         "field": "count",
         "reason": "invalid"
       }
     ],
     "status": "error"
   }

The errors field will contain a sequence of one or more errors for the request. Each error will indicate the field for which the error exists and a reason.

The reason field will have one of the following values.

Reason Description
missing The named field was required but no value was provided in the request.
invalid The value provided for the field is not valid. Check the resource documentation for more details.

4.

Attempting to create a new resource when another resource already exists with the same identifier will result in a 409 Conflict response.

An example of this is attempting to create a dataset with the same name as an existing dataset within the same organisation.

  HTTP/1.1 409 Conflict
  {
    "status": "conflict"
  }