/
Whatsapp API Response:
When failed delivery is notified to the customer:
Request
"POST || https://graph.facebook.com/v16.0/108687922264083/messages"
{
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "919650186697",
"type": "template",
"template": {
"name": "customer_unreacheable_ndr",
"language": {
"code": "en_US"
},
"components": [
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "John"
},
{
"type": "text",
"text": "KapasKraft"
},
{
"type": "text",
"text": "123456"
},
{
"type": "text",
"text": "2"
},
{
"type": "text",
"text": "9875367647"
},
{
"type": "text",
"text": "2 Kapaskraft Solid Grey Trousers"
}
]
}
]
}
}Response
{
"messaging_product": "whatsapp",
"contacts": [
{
"input": "919650186697",
"wa_id": "919650186697"
}
],
"messages": [
{
"id": "wamid.HBgMOTE5NjUwMTg2Njk3FQIAERgSQUM1RDgwMzMyRTNFRjdCNzQzAA=="
}
]
}Webhook notification (DLR)
Delivery status of message
{
"object": "whatsapp_business_account",
"entry": [
{
"id": "105945132543354",
"changes": [
{
"value": {
"messaging_product": "whatsapp",
"metadata": {
"display_phone_number": "15551009938",
"phone_number_id": "108687922264083"
},
"statuses": [
{
"id": "wamid.HBgMOTE5NjUwMTg2Njk3FQIAERgSQUM1RDgwMzMyRTNFRjdCNzQzAA==",
"status": "read",
"timestamp": "1687433938",
"recipient_id": "919650186697"
}
]
},
"field": "messages"
}
]
}
]
}The customer chooses an option (reply buttons) from the above template message:
Webhook response
{
"object": "whatsapp_business_account",
"entry": [
{
"id": "105945132543354",
"changes": [
{
"value": {
"messaging_product": "whatsapp",
"metadata": {
"display_phone_number": "15551009938",
"phone_number_id": "108687922264083"
},
"contacts": [
{
"profile": {
"name": "Lakshay"
},
"wa_id": "919650186697"
}
],
"messages": [
{
"context": {
"from": "15551009938",
"id": "wamid.HBgMOTE5NjUwMTg2Njk3FQIAERgSQjFENkE5NUE3RDYwQkVDMjAzAA=="
},
"from": "919650186697",
"id": "wamid.HBgMOTE5NjUwMTg2Njk3FQIAEhgUM0EyNDQwQTE4MUEwQjYyMzJBRTMA",
"timestamp": "1687433106",
"type": "button",
"button": {
"payload": "Select new delivery date",
"text": "Select new delivery date"
}
}
]
},
"field": "messages"
}
]
}
]
}Request
Providing customer set of options to choose a delivery date (reply buttons):
POST || https://graph.facebook.com/v16.0/108687922264083/messages
{
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "919650186697",
"type": "interactive",
"interactive": {
"type": "button",
"body": {
"text": "Please help us by selecting your preferred delivery date"
},
"action": {
"buttons": [
{
"type": "reply",
"reply": {
"id": "date-1",
"title": "23 June 2023"
}
},
{
"type": "reply",
"reply": {
"id": "date-2",
"title": "24 June 2023"
}
},
{
"type": "reply",
"reply": {
"id": "date-3",
"title": "25 June 2023"
}
}
]
}
}
}Response
{
"messaging_product": "whatsapp",
"contacts": [
{
"input": "919650186697",
"wa_id": "919650186697"
}
],
"messages": [
{
"id": "wamid.HBgMOTE5NjUwMTg2Njk3FQIAERgSNEM4RkMwNjIzNUJCQzM4NDAwAA=="
}
]
}WEBHOOK DLR
DLR
{
"object": "whatsapp_business_account",
"entry": [
{
"id": "105945132543354",
"changes": [
{
"value": {
"messaging_product": "whatsapp",
"metadata": {
"display_phone_number": "15551009938",
"phone_number_id": "108687922264083"
},
"statuses": [
{
"id": "wamid.HBgMOTE5NjUwMTg2Njk3FQIAERgSNEM4RkMwNjIzNUJCQzM4NDAwAA==",
"status": "read",
"timestamp": "1687433010",
"recipient_id": "919650186697"
}
]
},
"field": "messages"
}
]
}
]
}The customer chooses a delivery date:
WEBHOOK Incoming response from customer
{
"object": "whatsapp_business_account",
"entry": [
{
"id": "105945132543354",
"changes": [
{
"value": {
"messaging_product": "whatsapp",
"metadata": {
"display_phone_number": "15551009938",
"phone_number_id": "108687922264083"
},
"contacts": [
{
"profile": {
"name": "Lakshay"
},
"wa_id": "919650186697"
}
],
"messages": [
{
"context": {
"from": "15551009938",
"id": "wamid.HBgMOTE5NjUwMTg2Njk3FQIAERgSNEM4RkMwNjIzNUJCQzM4NDAwAA=="
},
"from": "919650186697",
"id": "wamid.HBgMOTE5NjUwMTg2Njk3FQIAEhgUM0FEREMxN0Y5QzY0OEJGNkMzRDIA",
"timestamp": "1687433238",
"type": "interactive",
"interactive": {
"type": "button_reply",
"button_reply": {
"id": "date-1",
"title": "23 June 2023"
}
}
}
]
},
"field": "messages"
}
]
}
]
}Final Request (for final message) sent to the customer:
After receiving the above webhook response from the customer we update delivery date the date and trigger the following message:
{
"messaging_product": "whatsapp",
"preview_url": false,
"recipient_type": "individual",
"to": "919650186697",
"type": "text",
"text": {
"body": "Thank you for your response. As requested by you we will cancel your order. Hope to see you again!"
}
}Response:
{
"messaging_product": "whatsapp",
"contacts": [
{
"input": "919650186697",
"wa_id": "919650186697"
}
],
"messages": [
{
"id": "wamid.HBgMOTE5NjUwMTg2Njk3FQIAERgSQzY0QUE2NzE0MjNDODQ2NTU2AA=="
}
]
}Webhook DLR of the final message to customer:
{
"object": "whatsapp_business_account",
"entry": [
{
"id": "105945132543354",
"changes": [
{
"value": {
"messaging_product": "whatsapp",
"metadata": {
"display_phone_number": "15551009938",
"phone_number_id": "108687922264083"
},
"statuses": [
{
"id": "wamid.HBgMOTE5NjUwMTg2Njk3FQIAERgSQzY0QUE2NzE0MjNDODQ2NTU2AA==",
"status": "delivered",
"timestamp": "1687433305",
"recipient_id": "919650186697",
"conversation": {
"id": "65f4754f3fc4ff8d1f550101eacf93d5",
"origin": {
"type": "utility"
}
},
"pricing": {
"billable": true,
"pricing_model": "CBP",
"category": "utility"
}
}
]
},
"field": "messages"
}
]
}
]
}Journey | Identifier | Customisable | Remarks |
---|---|---|---|
FDR Message | Template → name | Yes | |
FDR Message Webhook Response | entry → id | No | |