Our error responses can tell you which request body fields failed and why.
Wristband APIs return errors as either a JSON serialized ApiError
or ConstraintViolationsApiError
object.
ApiError Response
This is the default error response for most errors.
Response Fields
Name | Type | Description |
---|---|---|
type | String | The type of the error object. |
code | String | The API error code. |
message | String | The API error message. |
ticket | String | String for support and debugging purposes. |
Example Response
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8
{
"type": "base_error",
"code": "invalid_request",
"message": "The count parameter must be greater than or equal to 0",
"ticket": "v1c7nblicpvqia7fia8r5d2qeu"
}
ConstraintViolationsApiError Response
This error response is for invalid fields within an API request, with error codes specific to those fields.
Response Fields
Name | Type | Description |
---|---|---|
type | String | The type of the error object. |
code | String | The API error code. |
message | String | The API error message. |
ticket | String | String for support and debugging purposes. |
violations | Map<String, List> | Map with field names as keys and lists of ConstraintViolationDetails as values for fields with validation errors. |
ConstraintViolationDetails
Name | Type | Description |
---|---|---|
code | String | Field-specific error code indicating the issue with the request value. |
constraintAttributes | Map<String, String> | (Optional) Map describing the constraint that was violated, with attribute names as keys and values as attribute values. |
Example Response
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8
{
"type": "constraint_violations_error",
"code": "message_body_constraint_violations",
"message": "Field violations detected while trying to create a user",
"ticket": "jgqgau2nj4eobeaje6m4jhoop8",
"violations": {
"username": [{
"code": "too_long",
"constraintAttributes": {
"maxLength": "200"
}
}],
"externalId": [{
"code": "not_unique"
}]
}
}