我正在为 WhatsApp Cloud API 编写一个 webhook。我很好地接收了用户发起的消息,但是当我发送短信回复所述消息时,我从 WhatsApp API 获取以下 JSON:
{
"object": "whatsapp_business_account",
"entry": [
{
"id": "MY_ID",
"changes": [
{
"value": {
"messaging_product": "whatsapp",
"metadata": {
"display_phone_number": "NUMBER",
"phone_number_id": "PHONE"
},
"statuses": [
{
"id": "wamid.ENCRYPTED_CODE",
"status": "failed",
"timestamp": "TIMESTAMP",
"recipient_id": "ID",
"errors": [
{
"code": 131047,
"title": "Re-engagement message",
"message": "Re-engagement message",
"error_data": {
"details": "Message failed to send because more than 24 hours have passed since the customer last replied to this number."
},
"href": "https://developers.facebook.com/docs/whatsapp/cloud-api/support/error-codes/"
}
]
}
]
},
"field": "messages"
}
]
}
]
}
我最初的信息是:
{
"recipient_type": "individual",
"messaging_product": "whatsapp",
"to": "MY_NUMBER",
"text": {
"body": "My message."
},
"type": "text"
}
我预计消息会被传递,但我却收到了上述错误。
我也收到这条消息。就我而言,我注册为开发人员,并且应用程序处于开发模式。当我尝试向已在 Meta 仪表板上的设置中注册为有效收件人的号码发送消息时,我会收到此 JSON。