Validation errors
If the API fails to validate a request, it will respond with a 400 validation error message (JSON or XML) describing the issue.
The below validation errors are the most common and will respond with some details, including a list of validation messages. Validation errors typically occur when a request is malformed -- usually because a field has not been given the correct value type, or the JSON is misformatted.
Error types
- EndpointParameterError: caused by incorrect input parameters
- BooleanRequirement: the value must be either "true" or "false"
- ContentRequirement: the content supplied is blacklisted
- DateRequirement: the value must be a proper date
- IdRequirement: the value must be an integer greater than 0
- ImmutabilityRequirement: the value cannot be changed once it has been set
- IntegerRequirement: the value should be an integer
- NoDuplicatesRequirement: there is a duplicate value supplied in the request
- NotNullRequirement: the value cannot be null or missing
-
ObjectValidationError: a problem with one of the properties on the object
Some examples include:
- TextWithNoUrlRequirement: the value must not contain URLs
- TextWithNoHtmlRequirement: the value must not contain HTML
- DateRequirement: the value must contain a date
- EmailAddressRequirement: the value must contain an email address
- ValidTextLengthRequirement: the value does not contain a valid number of characters
- RelationshipRequirement: a relationship between two objects or related properties has not been met
- SyntaxRequirement: the HTML is not valid or could not be parsed
- UniquenessRequirement: the supplied name is not unique
- UrlRequirement: the supplied value should be a valid url
Example
For example, if you try to update a contact with id "sandwich" instead of an integer greater than zero:
GET https://.../data/contact/sandwich
Accept: application/json
You will receive a 400 response with "IdRequirement" error:
{
"type":"EndpointParameterError",
"parameter":"id",
"requirement":{
"type":"IdRequirement",
"isRelativeAllowed":false
},
"value":"sandwich"
}
From the above "Error types" list, we see that this error means " the value must be an integer greater than 0".