Inbound Replies to Sent Messages

Users can respond to a specific message on WhatsApp.

Inbound Replies

In order for the business to understand the context of a message reply, we need to include the context object.

This context object provides the id of the message to which the customer replied, the WhatsApp ID of the sender of the original message and IDs for any products the customer may be referring to.

🚧

The text field is optional for media messages. If it exists, the text value is the caption of the sent media or the body of the response, if the response is a text message.

📘

Example: Customer Replied to Your Message

The following is an example of an inbound message that is a reply to a message that you sent. See the context object section below for more information.

{
    "contacts": [
        {
            "profile": {
                "name": "Kerry Fisher"
            },
            "wa_id": "16315551234"
        }
    ],
    "messages": [
        {
            "context": {
                "from": "16315558011",
                "id": "ABGGFlA5FpafAgo6tHcNmNjXmuSf",
                 "clientReferenceID":""
            },
            "from": "16315551234",
            "id": "gBGGFlA5FpafAgkOuJbRq54qwbM",
            "text": {
                "body": "Yes, count me in!"
            },
            "timestamp": "1521499915",
            "type": "text"
        }
    ]
}
📘

Example: Customer Replied to a List Message

The following is an example of an inbound message that is a reply to a message that you sent. See the context object for more information.

{
  "messages": [
    {
      "context": {
        "from": "sender_wa_id_of_context_message",
        "group_id": "group_id_of_context_message",
        "id": "message_id_of_context_message",
        "mentions": [
          "wa_id1",
          "wa_id2"
        ]
      },
      "from": "sender_wa_id",
      "group_id": "group_id",
      "id": "message_id",
      "timestamp": "message_timestamp",
      "type": "interactive",
      "interactive": {
        "type": "list_reply",
        "list_reply": {
          "title": "row-title-content-here",
          "id": "unique-row-identifier-here",
          "description": "row-description-content-here"
        }
      }
    }
  ]
}
📘

Example: Customer Replied to a Reply Button Message

The following is an example of an inbound message that is sent after the customer clicked on a reply button. See the interactive object for more information.

{
  "messages": [
    {
      "context": {
        "from": "sender_wa_id_of_context_message",
        "group_id": "group_id_of_context_message",
        "id": "message_id_of_context_message",
        "mentions": [
          "wa_id1",
          "wa_id2"
        ]
      },
      "from": "sender_wa_id",
      "group_id": "group_id",
      "id": "message_id",
      "timestamp": "message_timestamp",
      "type": "interactive",
      "interactive": {
        "type": "button_reply",
        "button_reply": {
          "id": "unique-button-identifier",
          "title": "button-text"
        }
      }
    }
  ]
}
📘

Example: Customer Asking For Information About a Specific Product

The following is an example of an inbound message that is sent after the customer asks for more product info.

{
  "contacts": [
    {
      "profile": {
        "name": "customer-name"
      },
      "wa_id": "customer-whatsapp-ID"
    }
  ],
  "messages": [
    {
      "from": "customer-whatsapp-ID",
      "id": "message-ID",
      "text": {
        "body": "Can I get this in another color?"
      },
      "context": {
        "referred_product": {
          "catalog_id": "catalog-ID",
          "product_retailer_id": "product-ID"
        }
      },
      "timestamp": "message-received-timestamp",
      "type": "text"
    }
  ]
}
📘

Example: Customer placed an order after receiving a Multi or Single Product Message

The following is an example of an inbound message that is sent after the customer orders a single or multi-product.

{
   "messages": [ {
      "from": "customer-whatsapp-id",
      "group_id": "group-id",
      "id": "message-ID",
      "timestamp": "message-timestamp",
      "type": "order"
      "order": {
         "catalog_id": "catalog_id",
         "product_items": [
            {
            "product_retailer_id":"product-ID",
            "quantity":"number-of-items",
            "item_price":"unitary-price-of-item",
            "currency":"price-currency"
            }
         ],
         "text":"text-message-sent-along-with-the-order"
      }
   }
}