Error Response
A request is successfully accepted with an HTTP status code of 2xx. Otherwise, it indicates that something goes wrong with an HTTP status code of 4xx or 5xx. Codes in the 5xx range indicate an error with YONI-TECH's servers, while codes in the 4xx range indicate an error caused by clients.
A structured response body is returned when errors occur, here is an example of the response body for errors:
{
"error": {
"status": 401,
"code": "UNAUTHORIZED",
"message": "INVALID_API_KEY",
"requestId": "req_5MK6JhCWZezuquzDPHNDZY"
}
}
Error Object
status
REQUIRED. The HTTP status code generated by the server for this occurrence of the problem. It conveys the HTTP status code used for the convenience of the consumer.
code
REQUIRED. One of the server-defined error codes. Some 4xx errors that could be handled programmatically include an error code that briefly explains the error reported.
message
A human-readable representation of the error. It is intended as an aid to developers and is not suitable for exposure to end users.
target
The target of the error. It could be the parameter field when a parameter is invalid.
requestId
Each API request has an associated request ID. It conveys the response header X-Request-ID used for the convenience of the consumer.
whatsappApiError
The original error object returned by WhatsApp. See Handling Errors, Cloud API Error Codes.
Note: This field is returned if we tried to request Meta WhatsApp API and got an error response. Typically used for the Send a WhatsApp message directly API.