This event is fired whenever a reply from a contact is received.
Contact Phone Number
The field
data.contact.phone_number
will only be present in the webhook if the contact is responding to a message that was previously sent using a phone number (a template message).WhatsApp never shares anyone's phone number.
{
"event": "message_received",
"timestamp": "2016-10-06T13:42:48Z",
"data": {
"id": "6456078996108088196",
"channel": {
"id": "6456078759331238786",
"type": "whatsapp"
},
"contact": {
"id": "6456078781510718339",
"phone_number": "15558576389",
"platform_id": "15558576389",
"name": "Han Solo"
},
"content": {
"type": "text",
"payload": "That's really nice that I can write you here. You guys rock!",
"quick_reply": {
"payload": "DEVELOPER_DEFINED_PAYLOAD"
}
},
"nlp": {...}
}
}
Parameter | Type | Description |
---|---|---|
data | object | Object representing message received. The structure matches Message response structure except for the nlp key which is valid only for received messages. |
data.contact | object | Check Contact for fields description. |
data.content | object | You can receive: - Text - Image - Audio - File - Video - Location |
data.content.quick_reply | object | Only present when the message was created by the user tapping a Quick Reply button. Contains payload field which is used to identify which Quick Reply button was tapped. |