Error API Response

1. Errors

When CleanSpeak encounters an error or finds validation errors in your request, an Errors object is returned in the response body. The Errors object is defined as follows, where fieldName indicates the field in the request body the message is describing and [x] indicates the value is part of an array of one or more values.

generalErrors [Array]

The list of general error messages.

generalErrors[x].code [String]

The code of the error message.

generalErrors[x].message [String]

A descriptive error message that details the problem that occurred.

fieldErrors [Object]

The list of field error message.

fieldErrors[fieldName] [Array]

The list of error messages for that field

fieldErrors[fieldName][x].code [String]

The code of the error message.

fieldErrors[fieldName][x].message [String]

A descriptive error message that details the problem that occurred.

Example Errors JSON Object
{
  "generalErrors": [
    {
      "code": "[invalid]",
      "message": "Your JSON was invalid"
    }
  ],
  "fieldErrors" : {
    "content.applicationId" : [
      {
        "code" : "[missing]content.applicationId",
        "message" : "Your JSON request must contain a [content.applicationId] value as a UUID String."
      }
    ],
    "content.parts[0].type" : [
      {
        "code" : "[missing]content.parts.type",
        "message" : "Each object in the [content.parts] array must have a [type] value that is one of these values [audio, image, text, video, hyperlink, attribute]."
      }
    ]
  }
}