A description of error objects and status codes
Plutto uses standard HTTP response codes to indicate the success or failure of an API request.
As a rule of thumb, Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error in the provided information (e.g., a required parameter was omitted, a validation error has occurred, etc.). Codes in the 5xx range indicate an error with Plutto servers.
Some 4xx errors will include a brief explanation of the error in the response body.
The error object has the following keys:
{
"error": {
"type": "invalid_request_error",
"code": "resource_not_found",
"message": "The requested resource cannot be found. This item does not exist or has been previously removed.",
"detail": "Couldn't find Validation resource",
"param": null,
"request_id": null,
"docs_url": "https://plutto.readme.io"
}
}
Error types
Error Code | HTTP Code | Error Type | Message |
---|---|---|---|
bad_request | 400 | invalid_request_error | The request was unacceptable, often due to missing a required parameter. |
unprocessable_entity | 422 | invalid_request_error | Your request was understood, but we were not able to process it. Please fix it before repeating |
unauthorized | 401 | authentication_error | No valid API key provided. |
resource_not_found | 404 | invalid_request_error | The requested resource cannot be found. This item does not exist or has been previously removed. |
internal_server_error | 500 | api_error | Something went wrong by our side. We're probably already looking into it. |
service_unavailable | 503 | service_unavailable_error | The server is currently unavailable. Please try again later. |
External sources unavailable
When an external data source is down (Registro Empresas y Sociedades for example), and the request fail to process due that data source, Plutto API will respond with a 503 (
service_unavailable_error
).