Send Conversational WhatsApp Template Messages to Chatbot Systems

Prev Next

This feature is available on request. Please contact the Insider One team to enable it.

Insider now helps you identify which template message triggered a chatbot. Each time a template message is sent, Insider forwards the template information to your defined webhook. This lets you match chatbot responses with the right template inside your system.

Regardless of how the message content is triggered (whether through single, transactional, etc., via InOne), all messages classified as template message types will be transmitted to the previously defined webhook URL.

The content sent will generally mirror the message sending content dispatched to Meta, with the following additions based on your request:

  • timestamp: Indicates the exact time the message was sent to Meta.

  • content: Contains the template's message content.

Sample Webhook Payload

The following is a sample webhook payload sent to your system. It contains standard WhatsApp template message data along with Insider-specific fields (timestamp and content) that help you identify which template triggered the chatbot.

{
  "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "template": {
    "components": [
      {
        "index": "",
        "parameters": [
          {
            "type": "video",
            "video": {
              "link": "https://image.useinsider.com/vikingsankara/media/whatsapp-business/11210/mfNi3id2bgKyTihKM3S91713516030.mp4?utm_source=insider&utm_medium=whatsapp_business_api&utm_campaign=sfsdfsad"
              }
          }
        ],
        "sub_type": "",
        "type": "header"
      },
      {
        "index": "",
        "parameters": [],
        "sub_type": "",
        "type": "body"
      },
      {
        "index": "0",
        "parameters": [
          {
            "text": "?utm_source=insider&utm_medium=whatsapp_business_api&utm_campaign=sfsdfsad&isIns=1&msKey=D9BFn64184zDy4T",
            "type": "text"
          }
        ],
        "sub_type": "url",
        "type": "button"
      }
    ],
    "content": "Hi, this is a test message! Say welcome new media type, yay!",
    "language": {
      "code": "en",
      "policy": "deterministic"
    },
    "name": "new_media"
  },
  "timestamp": 1713518420,
  "to": "994558964184",
  "type": "template"
}

Sample Request

The following is a sample cURL request you can use to simulate how the webhook payload will be delivered to your system. This allows you to test and verify that your webhook is correctly receiving and handling the data.

curl --location 'https://webhook.site/8d7f9c8c-cc02-4725-8630-067ec0587810' \
--header 'Authorization: Bearer test' \
--header 'Content-Type: application/json' \
--data '{
  "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "template": {
    "components": [
      {
        "index": "",
        "parameters": [
          {
            "type": "video",
            "video": {
              "link": "https://image.useinsider.com/vikingsankara/media/whatsapp-business/11210/mfNi3id2bgKyTihKM3S91713516030.mp4?utm_source=insider&utm_medium=whatsapp_business_api&utm_campaign=sfsdfsad"
              }
          }
        ],
        "sub_type": "",
        "type": "header"
      },
      {
        "index": "",
        "parameters": [],
        "sub_type": "",
        "type": "body"
      },
      {
        "index": "0",
        "parameters": [
          {
            "text": "?utm_source=insider&utm_medium=whatsapp_business_api&utm_campaign=sfsdfsad&isIns=1&msKey=D9BFn64184zDy4T",
            "type": "text"
          }
        ],
        "sub_type": "url",
        "type": "button"
      }
    ],
    "content": "Hi, this is a test message! Say welcome new media type, yay!",
    "language": {
      "code": "en",
      "policy": "deterministic"
    },
    "name": "new_media"
  },
  "timestamp": 1713518420,
  "to": "994558964184",
  "type": "template"
}'