Send WhatsApp Template Message Data to Conversational Webhooks

Prev Next

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

Insider One can forward WhatsApp template message data to your webhook so your chatbot system can identify which template triggered the interaction.

Each time a template message is sent, Insider One forwards the template information to the webhook URL defined in your Conversational API configuration. This allows your system to match chatbot responses with the correct template message.

This behavior applies regardless of how the message is triggered, including WhatsApp Standalone, Architect WhatsApp, Transactional API, and Conversational API. All template message types are delivered to this webhook endpoint.

The webhook payload generally mirrors the original message content sent to Meta, with the following additional fields:

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

  • content: Contains the template 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"
}'

Sample Webhook Response

{
  "campaignId": "number",
  "campaignName": "string",
  "messaging_product": "string",
  "original_template": {
    "category": "string",
    "components": [
      {
        "buttons": "null | array",
        "text": "string",
        "type": "string"
      }
    ],
    "language": "string",
    "name": "string",
    "quality": "string",
    "status": "string"
  },
  "recipient_type": "string",
  "template": {
    "components": [
      {
        "index": "null | number",
        "parameters": [
          {
            "type": "string",
            "image": {
              "link": "string (uri)"
            },
            "text": "string"
          }
        ],
        "sub_type": "string",
        "type": "string"
      }
    ],
    "content": "string",
    "language": {
      "code": "string",
      "policy": "string"
    },
    "name": "string"
  },
  "timestamp": "number",
  "to": "string",
  "type": "string",
  "uuid": "string",
  "wamid": "string"
}

Identify the Message Source

You can identify which Insider One product triggered the WhatsApp message by checking specific fields in the API response.

Use the table below to match the response fields with the message source:

Response field

Value

Message source

journeyName, journeyId

-

Architect

campaignId

429496728

Conversational API

campaignId

429496729

Transactional API

campaignId

429496727

Verify API (OTP messages)

campaignId

Any other value

Standalone WhatsApp

If journeyName and journeyId are included in the response, the message was sent through Architect.

If campaignId is returned, match its value with the table above to determine the message source.