Reprtoir uses standard HTTP response codes to indicate the success or failure of an API request:
- Codes in the 200 range indicate success.
- Codes in the 400 range indicate a failure given the information provided.
- Codes in the 500 range indicate an error with the Reprtoir servers (very uncommon).
In the occurrence of 4xx response code, Reprtoir will provide a JSON error object with a message that briefly explains the error.
Error Response Structure
When an error occurs on a API request, we always respond with a JSON error object:
{
"error": {
"status": 403,
"code": "ERROR_MISSING_API_KEY",
"documentation": "https://docs.reprtoir.com/reference/errors",
"message": "API key is missing",
"details": null
}
}
Error Code Reference Table
Code | HTTP Status | Description |
---|---|---|
ERROR_MISSING_FEATURE | 400 | The request cannot perform due to a missing feature in your account. |
ERROR _INVALID_API_KEY | 401 | The API key used in the request is invalid. |
ERROR_INVALID_API_VERSION | 401 | The X-API-Version HTTP header of the request specified an invalid API version. |
ERROR_MISSING_API_KEY | 403 | The X-API-Key HTTP header of the request was not set. |
ERROR_RESOURCE_NOT_FOUND | 404 | The resource you were trying to retrieve was not found. |
ERROR_INVALID_PARAMETERS | 422 | The request contains some invalid parameters. You will receive more information on the details key of the JSON error object. |