๐จ Error Handling
The API returns HTTP status codes to indicate success or failure of requests.
2xx
codes indicate success.
4xx
codes indicate failures caused by the information sent by the customer or by the current state of the entities.
5xx
codes indicate service problems on the API side.
Listed below are the types of errors and possible API violations.
๐ฉGeneral
This section collects errors that could be returned by any endpoints listed in the API.
HTTP Status Code | Description |
---|---|
400 Bad Request | Invalid request |
401 Unauthorized | JWT is required |
403 Forbidden | Request from an authenticated participant that violates an authorization rule |
404 Not Found | Resource not found |
405 Not Allowed | Method Not Allowed |
409 Conflict | The Resource you want to create has a data conflict with another Resource |
415 Unsupported Media Type | Invalid Content-Type |
500 Internal Server Error | Unexpected condition when processing request. Contact the Liber Capital API Support for more information. |
503 Service Unavailable | The service is currently unavailable. The requested service may be under maintenance or outage |
504 Gateway Timeout | Indicates that the service took longer than expected to return |
๐ง Problem + JSON
- a matter or situation regarded as unwelcome or harmful and needing to be dealt with and overcome.
The Liber Capital's API use this content example for all kind of errors, but the details
field can be present or not, depends on the kind of error you received. The Content-Type is always application/problem+json
.
This errors has the same fields to represent our Response Error following the RFC 7807:
Field | Type | Description |
---|---|---|
type | string | Optional A URL of this documentation about the kind of error the Client received. |
title | string | Required A description about the error. |
status | int | Required Status code equals HTTP Response. |
detail | string | Required Indicates the message detail about this error. |
invalid_params | array(object) | Optional human-friendly message and fields about this error. i.e {"name":"field_name", "reason": "is required"} |
The invalid_params
only appear when is invalid input, then you will see always name
and reason
properties, the reason property always there will be key word, as said on RFC 2129.
Updated 4 months ago