Errors
In this guide, we'll look at what happens when something goes wrong during an API interaction.
You can tell if your request was successful by checking the API response for a 2xx status code. But if a response comes back unsuccessful, you'll want to use the error code and message to debug the issue.
Status codes
Here is a list of the different categories of status codes returned by the Zamp API:
- Name
2xx
A 2xx status code indicates a successful response.
- Name
4xx
A 4xx status code indicates a client error — these are typically validation or rate limit errors.
- Name
5xx
A 5xx status code indicates a server error — this means something went wrong processing the request in our system.
Common errors
Here is a list of error codes and statuses returned by the Zamp API:
- Name
PARSE_ERROR
- Type
- 400
Content-Type was not set to application/json or the request contained a malformed JSON payload.
- Name
BAD_REQUEST
- Type
- 400
Request was invalid and could not be processed.
- Name
UNAUTHORIZED
- Type
- 401
Failed to authenticate bearer token in the Authorization header.
- Name
FORBIDDEN
- Type
- 403
Request was valid but lacked permission for the requested resource.
- Name
NOT_FOUND
- Type
- 404
Specified resource was not found.
- Name
TIMEOUT
- Type
- 408
The server was unable to generate a response within time constraints.
- Name
CONFLICT
- Type
- 409
The specified resource already exists.
- Name
TOO_MANY_REQUESTS
- Type
- 429
Rate of requests exceeded quota so request was rejected.
- Name
INTERNAL_SERVER_ERROR
- Type
- 500
Server encountered an error while processing request.
Response: rate limit error
{
"code": "TOO_MANY_REQUESTS",
"message": "Rate limit exceeded"
}
Response: bad request error
{
"code": "BAD_REQUEST",
"message": "Input validation failed",
"issues": [
{
"code": "invalid_type",
"message": "Required",
"path": ["payload"],
"expected": "string",
"received": "undefined"
}
]
}
Other errors
These are less common errors that may occur:
- Name
METHOD_NOT_SUPPORTED
- Type
- 405
- Name
PRECONDITION_FAILED
- Type
- 412
- Name
PAYLOAD_TOO_LARGE
- Type
- 413
- Name
UNPROCESSABLE_CONTENT
- Type
- 422
- Name
CLIENT_CLOSED_REQUEST
- Type
- 499