HTTP Error Status Codes
All Hiya APIs return a status code of 2xx (200/201/202/204/206) if they were called correctly and there weren't any issues with the request.
Otherwise, they'll return one of the following error codes:
Status | Description |
---|---|
301/302: Moved Permanently/Found | This API is in the process of being deprecated and you must update the code. |
400: Bad Request | A required parameter is missing or has an invalid value. |
401: Unauthorized | The API Key is invalid or missing. |
403: Forbidden | The API Key doesn't have the necessary authorization to access this resource |
404: Not Found | This API doesn't exist (or has been fully deprecated) or resource not found |
408: Request Timeout | A complete request was not received by the server within its allotted timeout period. Retry. |
409: Conflict | Resource already exists. |
415: Unsupported Media Type | Content-Type, Content-Encoding or payload of the request is not supported. |
429: Too Many Requests | The number of requests within a given time period was exceeded. |
500: Internal Server Error | The server has experienced an unexpected condition and is unable to process the request. |
In addition, in the case of a 4xx or 5xx status code, the body of the API response might include an object with more information about the error(s):
{
"error": {
"id": "eeffac7a055740fab1d31d7626116cc8",
"code": 400,
"errors": [
{
"message": "Display name cannot be empty"
},
{
"message": "Malformed phone number"
}
]
}
}
Generally the API will return only a singular error at once, multiple errors could be returned only while validating the request json itself, so there is no guarantee that the API returns all errors in one turn.
Property | Type | Description |
---|---|---|
error.id | string | A unique error ID |
error.code | int | Equals to the returned http status code |
error.errors[*].message | string | Array of error messages |
We recommend you log all errors and the associated API request that returned this error in case it's necessary to investigate an issue.