Errors and Compatibility
How to navigate the API responses.
Handling Errors
Amplemarket uses convention HTTP response codes to indicate the success or failure of an API request.
Some errors that could be handled programmatically include an error code that briefly describes the reported error. When this happens, you can find details within the response under the field _errors
.
Error Object
An error object MAY have the following members, and MUST contain at least on of:
-
id
(string) - a unique identifier for this particular occurrence of the problem -
status
(string) - the HTTP status code applicable to this problem -
code
(string) - an application-specific error code -
title
(string) - human-readable summary of the problem that SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization -
detail
(string) - a human-readable explanation specific to this occurrence of the problem, and can be localized -
source
(object) - an object containing references to the primary source of the error which SHOULD include one of the following members or be omitted:-
pointer
: a JSON Pointer RFC6901 to the value in the request document that caused the error (e.g."/data"
for a primary data object, or"/data/attributes/title"
for a specific attribute). This MUST point to a value in the request document that exists; if it doesn’t, then client SHOULD simply ignore the pointer. -
parameter
: a string indicating which URI query parameter caused the error. -
header
: a string indicating the name of a single request header which caused the error.
-
Example:
Error Codes
The following error codes may be returned by the API:
code | title | Description |
---|---|---|
internal_server_error | Internal Server Error | An unexpected error occurred |
insufficient_credits | Insufficient Credits | The account doesn’t have enough credits to continue the operation |
person_not_found | Person Not Found | A matching person was not found in our database |
unavailable_for_legal_reasons | Unavailable For Legal Reasons | A matching person was found in our database, but has been removed due to privacy reasons |
unsupported_value | Unsupported Value | Request has a field containing a value unsupported by the operation; more details within the corresponding error object |
missing_field | Missing Field | Request is missing a mandatory field; more details within the corresponding error object |
unauthorized | Unauthorized | The API credentials used are either invalid, or the user is not authorized to perform the operation |
Compatibility
When receiving data from Amplemarket please take into consideration that adding fields to the JSON output is considered a backwards-compatible change and it may happen without prior warning or through explicit versioning.
Was this page helpful?