YCloud failed to send messages
whatsappApiError in response body
whatsappApiError in response bodyYou may get an error response body including the field error.whatsappApiError when you send WhatsApp messages by the YCloud API, typically the Send a WhatsApp message directly API.
Here is a sample error response with HTTP status 429 when you send too many messages to the same phone number:
{
"error": {
"status": 429,
"code": "TOO_MANY_REQUESTS",
"message": "(#131056) (Business Account, Consumer Account) pair rate limit hit",
"target": "whatsappApiError",
"docUrl": "https://developers.facebook.com/docs/whatsapp/cloud-api/support/error-codes",
"requestId": "req_1KjtKI80IKoaJNa6n6p",
"whatsappApiError": {
"message": "(#131056) (Business Account, Consumer Account) pair rate limit hit",
"type": "OAuthException",
"code": "131056",
"fbtrace_id": "A4O5a8RAgePwbcGSu",
"error_data": {
"messaging_product": "whatsapp",
"details": "Message failed to send because there were too many messages sent from this phone number to the same phone number in a short period of time."
}
}
}
}In this case, we tried to request the WhatsApp Business API and got an error response. error.whatsappApiError is included to help you identify the error reason.
whatsappApiError in webhook payload
whatsappApiError in webhook payloadIf you are using the Enqueue a WhatsApp message API, you will never get an error response having error.whatsappApiError since we submit your messages to the WhatsApp Business API asynchronously. You can get it by configuring a webhook listening for whatsapp.message.updated events. Here is an example of the webhook payload:
{
"id": "evt_eEVCy8eNqD9EvcFI",
"type": "whatsapp.message.updated",
"apiVersion": "v2",
"createTime": "2023-02-22T12:00:00.000Z",
"whatsappMessage": {
"id": "63f5d602367ea403f8175a6c",
"wamid": "wamid.BgNODYxN...",
"status": "failed",
"errorCode": "131056",
"errorMessage": "(#131056) (Business Account, Consumer Account) pair rate limit hit",
"whatsappApiError": {
"message": "(#131056) (Business Account, Consumer Account) pair rate limit hit",
"type": "OAuthException",
"code": "131056",
"fbtrace_id": "A4O5a8RAgePwbcGSu",
"error_data": {
"messaging_product": "whatsapp",
"details": "Message failed to send because there were too many messages sent from this phone number to the same phone number in a short period of time."
}
},
"totalPrice": 0.0,
"currency": "USD",
"bizType": "whatsapp"
}Error Codes returned by the WhatsApp Business API
The whatsappApiError is exactly the WhatsApp Business Cloud API Error. Listed below are some possible error codes that may be returned through the YCloud API.
| Code | Description | Possible Solutions | HTTP Status |
|---|---|---|---|
2API Service | Temporary due to downtime or due to being overloaded. | Check the WhatsApp Business Platform Status page to see API status information before trying again. | 503Service Unavailable |
100Invalid parameter | The request included one or more unsupported or misspelled parameters. Or the recipient phone number is not a WhatsApp phone number. | 400Bad Request | |
130429Rate limit hit | Cloud API message throughput has been reached. | The app has reached the API's throughput limit. See Throughput. Try again later or reduce the frequency with which the app sends messages. | 429Too Many Requests |
131000Something went wrong | Message failed to send due to an unknown error. | Try again. If the error persists, contact us to open a Direct Support ticket. | 500Internal Server Error |
131008Required parameter is missing | The request is missing a required parameter. | 400Bad Request | |
131026Message Undeliverable | Unable to deliver message. Reasons can include: • The recipient phone number is not a WhatsApp phone number. • Recipient has not accepted our new Terms of Service and Privacy Policy. • Recipient using an old WhatsApp version; must use the following WhatsApp version or greater: • Android: 2.21.15.15 • SMBA: 2.21.15.15 • iOS: 2.21.170.4 • SMBI: 2.21.170.4 • KaiOS: 2.2130.10 • Web: 2.2132.6 | Using a non-WhatsApp communication method, ask the WhatsApp user to: • Confirm that they can actually send a message to your WhatsApp business phone number. • Confirm that they have accepted our latest Terms of Service (Settings > Help, or Settings > Application information will prompt them to accept the latest terms/policies if they haven't done so already) • Update to the latest version of the WhatsApp client. | 400Bad Request |
131031Account has been locked | The WhatsApp Business Account associated with the app has been restricted or disabled for violating a platform policy, or we were unable to verify data included in the request against data set on the WhatsApp Business Account (e.g, the two-step pin included in the request is incorrect). | See the Policy Enforcement document to learn about policy violations and how to resolve them. | 403Forbidden |
131056(Business Account, Consumer Account) pair rate limit hit | Too many messages sent from the sender phone number to the same recipient phone number in a short period of time. | Wait and retry the operation, if you intend to send messages to the same phone number. You can still send messages to a different phone number without waiting. | 429Too Many Requests |
132000Template Param Count Mismatch | The number of variable parameter values included in the request did not match the number of variable parameters defined in the template. | Make sure the request includes all of the variable parameter values that have been defined in the template. | 400Bad Request |
132001Template does not exist | The template does not exist in the specified language or the template has not been approved. | Make sure your template has been approved and the template name and language locale are correct. | 400Bad Request |
132007Template Format Character Policy Violated | Template content violates a WhatsApp policy. | See Rejection Reasons to determine possible reasons for violation. | 400Bad Request |
132012Template Parameter Format Mismatch | Variable parameter values formatted incorrectly. | The variable parameter values included in the request are not using the format specified in the template. | 400Bad Request |
132015Template is Paused | Template is paused due to low quality so it cannot be sent in a template message. | Edit the template to improve its quality and try again once it is approved. | 400Bad Request |
132016Template is Disabled | Template has been paused too many times due to low quality and is now permanently disabled. | Create a new template with different content. | 400Bad Request |
133010Phone number Not Registered | Business Phone number not registered on the WhatsApp Business Platform. | Register the phone number before trying again. | 400Bad Request |
130472User's number is part of an experiment | Message was not sent as part of an experiment. | See Marketing Message Experiment. | 400Bad Request |
Error Codes returned by the YCloud API
Be aware that error.whatsappApiError is not included when errors were detected by YCloud and we didn't request the WhatsApp Business API. For example, you provide an invalid phone number and then get the error response:
{
"error": {
"status": 400,
"code": "PARAM_INVALID",
"message": "Invalid E.146 phone number: +001",
"target": "to",
"docUrl": "https://docs.ycloud.com/v2/reference/errors#param_invalid",
"requestId": "req_69UpMOaMHFrBMGZexYvUDw"
}
}The error.code is one of the YCloud server-defined error codes.
Listed below are some possible error codes returned by the YCloud API:
| Code | Description | HTTP Status |
|---|---|---|
| PARAM_INVALID | One or more of the parameters is invalid. | 400Bad Request |
| PARAM_MISSING | One or more of the parameters is missing. | 400Bad Request |
| BALANCE_INSUFFICIENT | The account balance is insufficient. | 403Forbidden |
| WHATSAPP_BUSINESS_ACCOUNT_UNAVAILABLE | The WhatsApp business account is unavailable. | 403Forbidden |
| WHATSAPP_PHONE_NUMBER_UNAVAILABLE | The WhatsApp business phone number is unavailable. | 403Forbidden |
| WHATSAPP_TEMPLATE_UNAVAILABLE | The WhatsApp template is unavailable. | 403Forbidden |
| UNAUTHORIZED | Unauthorized. Make sure you are using the correct API Key in the 'X-API-Key' header. | 403Forbidden |
YCloud Error Codes conveyed by webhooks
If you are using the Enqueue a WhatsApp message endpoint, the message may fail due to a YCloud error. That is, the whatsappMessage.errorCode in webhook payload can also convey one of the YCloud Error Codes, such as BALANCE_INSUFFICIENT.
Here are some possible errors:
| Error Code | Description | Possible Solutions |
|---|---|---|
INTERNAL_SERVER_ERROR | Temporary due to downtime or due to being overloaded. | Wait and retry the operation. This error may be caused by a timeout in our call to the WhatsApp Business API. |
BALANCE_INSUFFICIENT | Your account balance is insufficient. | Top-up. |
RECIPIENT_UNSUBSCRIBED | The recipient has unsubscribed. | If you must deliver the message to the recipient, set the request parameter filterUnsubscribed to false, or go to Dashboard → Contact → Unsubscribe and remove them from the unsubscribe list. |
Meta failed to send messages
Not all of the error codes listed in the WhatsApp Business Cloud API Error page are returned through the YCloud API. Even if a message is successfully submitted to the WhatsApp Business API, it may also fail to send. Meta notifies YCloud about these errors via webhooks. You should Configure Webhooks listening for whatsapp.message.updated events to receive these notifications from YCloud. Here is an example of the webhook payload for submitted but finally failed messages:
{
"id": "evt_eEVCy8eNqD9EvcFI",
"type": "whatsapp.message.updated",
"apiVersion": "v2",
"createTime": "2023-02-22T12:00:00.000Z",
"whatsappMessage": {
"id": "63f5d602367ea403f8175a6c",
"wamid": "wamid.BgNODYxN...",
"status": "failed",
"errorCode": "131048",
"errorMessage": "Message failed to send because there are restrictions on how many messages can be sent from this phone number.This may be because too many previous messages were blocked or flagged as spam.",
"totalPrice": 0.0,
"currency": "USD",
"bizType": "whatsapp"
}
}The whatsappMessage.errorCode conveys the WhatsApp Business API Error code.
Meta Error Codes conveyed by webhooks
Listed below are some possible error codes conveyed by YCloud webhooks, that originated from Meta webhooks:
| Code | Description | Possible Solutions |
|---|---|---|
131000Something went wrong | Message failed to send due to an unknown error. | Try again. If the error persists, contact us to open a Direct Support ticket. |
131026Message Undeliverable | Unable to deliver message. Reasons can include: • The recipient phone number is not a WhatsApp phone number. • Recipient has not accepted our new Terms of Service and Privacy Policy. • Recipient using an old WhatsApp version; must use the following WhatsApp version or greater: • Android: 2.21.15.15 • SMBA: 2.21.15.15 • iOS: 2.21.170.4 • SMBI: 2.21.170.4 • KaiOS: 2.2130.10 • Web: 2.2132.6 | Using a non-WhatsApp communication method, ask the WhatsApp user to: • Confirm that they can actually send a message to your WhatsApp business phone number. • Confirm that they have accepted our latest Terms of Service (Settings > Help, or Settings > Application information will prompt them to accept the latest terms/policies if they haven't done so already) • Update to the latest version of the WhatsApp client. |
131031Account has been locked | The WhatsApp Business Account associated with the app has been restricted or disabled for violating a platform policy, or we were unable to verify data included in the request against data set on the WhatsApp Business Account (e.g, the two-step pin included in the request is incorrect). | See the Policy Enforcement document to learn about policy violations and how to resolve them. |
131047Re-engagement message | More than 24 hours have passed since the recipient last replied to the sender number. | Send the recipient a business-initiated message using a message template instead. |
131048Spam rate limit hit | Message failed to send because there are restrictions on how many messages can be sent from this phone number. This may be because too many previous messages were blocked or flagged as spam. | Check your quality status in the WhatsApp Manager and see the Quality-Based Rate Limits documentation for more information. |
131049 | This message was not delivered to maintain healthy ecosystem engagement. | Do not retry immediately if you do receive this error code and suspect it is due to the limit. Instead, retry in increasing larger time increments until the message is delivered, since the limit may be in effect for differing periods of time. See Per-User Marketing Template Message Limits for additional information. |
131053Media upload error | Unable to upload the media used in the message. | We were unable to upload the media for one or more reasons, such as an unsupported media type. |
131050Message Undeliverable | Unable to deliver the message. This recipient has chosen to stop receiving marketing messages on WhatsApp from your business |
