whatsapp-cloud-api
whatsapp-cloud-api copied to clipboard
Bug - Support empty profile name of Contact
Bug
I got a webhook notification from WhatsApp to verify a number, and their internal number doesn't contain a Profile name. Currently, my application is returning an error for the webhook, and WhatsApp is still trying to process the event for a few days/
Payload:
{
"object": "whatsapp_business_account",
"entry": [
{
"id": "820875440573402",
"changes": [
{
"value": {
"messaging_product": "whatsapp",
"metadata": {
"display_phone_number": "******",
"phone_number_id": "**********"
},
"contacts": [
{
"wa_id": "447710173736"
}
],
"messages": [
{
"from": "447710173736",
"id": "wamid.HBgMNDQ3NzEwMTczNzM2FQIAEhgSREU3NzBDMEFFRUY0OEFDNEVFAA==",
"timestamp": "1764898735",
"text": {
"body": "12345 is your Instagram code. Don't share it."
},
"type": "text"
}
]
},
"field": "messages"
}
]
}
]
}
Exception:
ErrorException
Undefined array key "profile"
Netflie\WhatsAppCloudApi\WebHook\Notification\MessageNotificationFactory->decorateNotification()
vendor/netflie/whatsapp-cloud-api/src/WebHook/Notification/MessageNotificationFactory.php:133