To convey the status of each response, HostCap uses conventional HTTP response codes to indicate success or failure. In general, codes in the 2xx range indicate success. Codes in the 4xx range indicate an error (e.g. required parameters, failed request etc.). Codes in the 5xx range indicate a server error occurred
Error Response
Below is the expected structure for an error response;
{
"code": "INSUFFICIENT_PERMISSIONS",
"message": "Access without required permissions is forbidden"
}
The code in the response body indicates the specific reason for the error response.
The expected codes for the HTTP error response codes are;
400
INSUFFICIENT_FUNDSCURRENCY_MISMATCHKYC_INCOMPLETECURRENCY_NOT_SUPPORTEDBAD_REQUESTDUPLICATE_TRANSACTIONACCOUNT_RESTRICTED
403
WALLET_ASSET_LOCKEDINSUFFICIENT_PERMISSIONSFORBIDDEN
404
RESOURCE_NOT_FOUND
500
SERVER_ERROR
Response Codes
Below is a list of expected response codes;
| Status Code | Response Type | Description |
|---|---|---|
| 200 | Successful | Request was complete successfully with a response. |
| 201 | Created | Resource was created successfully. |
| 400 | Bad Request | Invalid request parameter. |
| 403 | Forbidden | You do not have sufficient authorization to access the request resource. Your token is either unavailable, expired, or does not have the permission required to access the requested resource. |
| 404 | Not Found | The requested resource does not exist. |
| 500 | Server Error | The server being unable to correctly process a request. This is a relatively uncommon response. Please email: [email protected]. |
| 503 | Service Unavailable | A third party service failure. This is a relatively uncommon response. Please email: [email protected]. |
