The VerticalResponse API is able to respond accordingly to a wide range of error conditions with a rich set of information. The response format is consistent across API calls consisting of the standard url and links nodes related to the endpoint, as well as a status node providing information about the error including the HTTP error code, a message, and additional fields specific to the API call and error.
The following example shows an error response for an invalid DELETE request that was made on the endpoint for creating a contact:
As this example shows, additional fields such as method and params are included in the status node to provide information related to the invalid operation. In this case, the method field indicates that the DELETE method was called, while the params field is empty, indicating that no parameters were passed in.
The following is another example showing a response to a request where an invalid value of “whatever” was specified for the type parameter:
In this example, the params field lists the parameters passed into the request, and also includes a failures field describing the valid values for the type parameter.
For information on the specific fields that will be returned for specific error conditions, please see the API reference guide. The following table lists some of the more common HTTP codes that may be returned. Note that the message returned will vary depending on the specific call.
|200||The operation was successful.|
|400||The requested operation failed (e.g. when an invalid email address is passed in).|
|403||One or more of the credentials provided (e.g. access token) are invalid.|
|404||Could not access the specified item (e.g. an invalid list ID was specified).|
|405||The requested operation is not valid on the specified endpoint (e.g. when trying to call DELETE on the endpoint for creating a contact).|
|406||The specified response type in the Accept request header is invalid (the API only supports JSON).|
|409||The specified entity (e.g. contact) already exists.|
|500||An unexpected internal server error occurred.|