/
Whatsapp API Response:

When failed delivery is notified to the customer:

  • Request

1"POST || https://graph.facebook.com/v16.0/108687922264083/messages" 2 3{ 4 "messaging_product": "whatsapp", 5 "recipient_type": "individual", 6 "to": "919650186697", 7 "type": "template", 8 "template": { 9 "name": "customer_unreacheable_ndr", 10 "language": { 11 "code": "en_US" 12 }, 13 "components": [ 14 { 15 "type": "body", 16 "parameters": [ 17 { 18 "type": "text", 19 "text": "John" 20 }, 21 { 22 "type": "text", 23 "text": "KapasKraft" 24 }, 25 { 26 "type": "text", 27 "text": "123456" 28 }, 29 { 30 "type": "text", 31 "text": "2" 32 }, 33 { 34 "type": "text", 35 "text": "9875367647" 36 }, 37 { 38 "type": "text", 39 "text": "2 Kapaskraft Solid Grey Trousers" 40 } 41 ] 42 } 43 ] 44 } 45}
  • Response

1{ 2 "messaging_product": "whatsapp", 3 "contacts": [ 4 { 5 "input": "919650186697", 6 "wa_id": "919650186697" 7 } 8 ], 9 "messages": [ 10 { 11 "id": "wamid.HBgMOTE5NjUwMTg2Njk3FQIAERgSQUM1RDgwMzMyRTNFRjdCNzQzAA==" 12 } 13 ] 14}
  • Webhook notification (DLR)

1Delivery status of message 2 3{ 4 "object": "whatsapp_business_account", 5 "entry": [ 6 { 7 "id": "105945132543354", 8 "changes": [ 9 { 10 "value": { 11 "messaging_product": "whatsapp", 12 "metadata": { 13 "display_phone_number": "15551009938", 14 "phone_number_id": "108687922264083" 15 }, 16 "statuses": [ 17 { 18 "id": "wamid.HBgMOTE5NjUwMTg2Njk3FQIAERgSQUM1RDgwMzMyRTNFRjdCNzQzAA==", 19 "status": "read", 20 "timestamp": "1687433938", 21 "recipient_id": "919650186697" 22 } 23 ] 24 }, 25 "field": "messages" 26 } 27 ] 28 } 29 ] 30}

The customer chooses an option (reply buttons) from the above template message:

  • Webhook response

1{ 2 "object": "whatsapp_business_account", 3 "entry": [ 4 { 5 "id": "105945132543354", 6 "changes": [ 7 { 8 "value": { 9 "messaging_product": "whatsapp", 10 "metadata": { 11 "display_phone_number": "15551009938", 12 "phone_number_id": "108687922264083" 13 }, 14 "contacts": [ 15 { 16 "profile": { 17 "name": "Lakshay" 18 }, 19 "wa_id": "919650186697" 20 } 21 ], 22 "messages": [ 23 { 24 "context": { 25 "from": "15551009938", 26 "id": "wamid.HBgMOTE5NjUwMTg2Njk3FQIAERgSQjFENkE5NUE3RDYwQkVDMjAzAA==" 27 }, 28 "from": "919650186697", 29 "id": "wamid.HBgMOTE5NjUwMTg2Njk3FQIAEhgUM0EyNDQwQTE4MUEwQjYyMzJBRTMA", 30 "timestamp": "1687433106", 31 "type": "button", 32 "button": { 33 "payload": "Select new delivery date", 34 "text": "Select new delivery date" 35 } 36 } 37 ] 38 }, 39 "field": "messages" 40 } 41 ] 42 } 43 ] 44}
  • Request

Providing customer set of options to choose a delivery date (reply buttons):

1POST || https://graph.facebook.com/v16.0/108687922264083/messages 2 3{ 4 "messaging_product": "whatsapp", 5 "recipient_type": "individual", 6 "to": "919650186697", 7 "type": "interactive", 8 "interactive": { 9 "type": "button", 10 "body": { 11 "text": "Please help us by selecting your preferred delivery date" 12 }, 13 "action": { 14 "buttons": [ 15 { 16 "type": "reply", 17 "reply": { 18 "id": "date-1", 19 "title": "23 June 2023" 20 } 21 }, 22 { 23 "type": "reply", 24 "reply": { 25 "id": "date-2", 26 "title": "24 June 2023" 27 } 28 }, 29 { 30 "type": "reply", 31 "reply": { 32 "id": "date-3", 33 "title": "25 June 2023" 34 } 35 } 36 ] 37 } 38 } 39}
  • Response

1{ 2 "messaging_product": "whatsapp", 3 "contacts": [ 4 { 5 "input": "919650186697", 6 "wa_id": "919650186697" 7 } 8 ], 9 "messages": [ 10 { 11 "id": "wamid.HBgMOTE5NjUwMTg2Njk3FQIAERgSNEM4RkMwNjIzNUJCQzM4NDAwAA==" 12 } 13 ] 14}
  • WEBHOOK DLR

1DLR 2{ 3 "object": "whatsapp_business_account", 4 "entry": [ 5 { 6 "id": "105945132543354", 7 "changes": [ 8 { 9 "value": { 10 "messaging_product": "whatsapp", 11 "metadata": { 12 "display_phone_number": "15551009938", 13 "phone_number_id": "108687922264083" 14 }, 15 "statuses": [ 16 { 17 "id": "wamid.HBgMOTE5NjUwMTg2Njk3FQIAERgSNEM4RkMwNjIzNUJCQzM4NDAwAA==", 18 "status": "read", 19 "timestamp": "1687433010", 20 "recipient_id": "919650186697" 21 } 22 ] 23 }, 24 "field": "messages" 25 } 26 ] 27 } 28 ] 29}

The customer chooses a delivery date:

WEBHOOK Incoming response from customer

1{ 2 "object": "whatsapp_business_account", 3 "entry": [ 4 { 5 "id": "105945132543354", 6 "changes": [ 7 { 8 "value": { 9 "messaging_product": "whatsapp", 10 "metadata": { 11 "display_phone_number": "15551009938", 12 "phone_number_id": "108687922264083" 13 }, 14 "contacts": [ 15 { 16 "profile": { 17 "name": "Lakshay" 18 }, 19 "wa_id": "919650186697" 20 } 21 ], 22 "messages": [ 23 { 24 "context": { 25 "from": "15551009938", 26 "id": "wamid.HBgMOTE5NjUwMTg2Njk3FQIAERgSNEM4RkMwNjIzNUJCQzM4NDAwAA==" 27 }, 28 "from": "919650186697", 29 "id": "wamid.HBgMOTE5NjUwMTg2Njk3FQIAEhgUM0FEREMxN0Y5QzY0OEJGNkMzRDIA", 30 "timestamp": "1687433238", 31 "type": "interactive", 32 "interactive": { 33 "type": "button_reply", 34 "button_reply": { 35 "id": "date-1", 36 "title": "23 June 2023" 37 } 38 } 39 } 40 ] 41 }, 42 "field": "messages" 43 } 44 ] 45 } 46 ] 47}

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:

1{ 2 "messaging_product": "whatsapp", 3 "preview_url": false, 4 "recipient_type": "individual", 5 "to": "919650186697", 6 "type": "text", 7 "text": { 8 "body": "Thank you for your response. As requested by you we will cancel your order. Hope to see you again!" 9 } 10}


Response:

1{ 2 "messaging_product": "whatsapp", 3 "contacts": [ 4 { 5 "input": "919650186697", 6 "wa_id": "919650186697" 7 } 8 ], 9 "messages": [ 10 { 11 "id": "wamid.HBgMOTE5NjUwMTg2Njk3FQIAERgSQzY0QUE2NzE0MjNDODQ2NTU2AA==" 12 } 13 ] 14}

Webhook DLR of the final message to customer:

1 2{ 3 "object": "whatsapp_business_account", 4 "entry": [ 5 { 6 "id": "105945132543354", 7 "changes": [ 8 { 9 "value": { 10 "messaging_product": "whatsapp", 11 "metadata": { 12 "display_phone_number": "15551009938", 13 "phone_number_id": "108687922264083" 14 }, 15 "statuses": [ 16 { 17 "id": "wamid.HBgMOTE5NjUwMTg2Njk3FQIAERgSQzY0QUE2NzE0MjNDODQ2NTU2AA==", 18 "status": "delivered", 19 "timestamp": "1687433305", 20 "recipient_id": "919650186697", 21 "conversation": { 22 "id": "65f4754f3fc4ff8d1f550101eacf93d5", 23 "origin": { 24 "type": "utility" 25 } 26 }, 27 "pricing": { 28 "billable": true, 29 "pricing_model": "CBP", 30 "category": "utility" 31 } 32 } 33 ] 34 }, 35 "field": "messages" 36 } 37 ] 38 } 39 ] 40}


Journey

Identifier

Customisable

Remarks

FDR Message

Template → name

Yes


FDR Message Webhook Response

entry → id

No