Keyword (Webhook WhatsApp)

The platform sends data to your webhook URL in JSON payload format. Your webhook must be configured to handle the payload contents. The webhook forwards data to your application for further processing.

The payload sent to the webhook URL varies depending on the message type received from the end user.

📘

NOTE

These JSON payloads will be sent to the Webhook URL if you opt for WhatsApp as broadcast when creating and setting as Live a keyword.

For example, when the end user sends any of the following message types, the JSON payload will vary.

  • Simple text with emojis and line breaks
{
  "owner": "[email protected]",
  "date": "2023-12-12T18:58:44.819365532Z",
  "processId": 2222,
  "origin": "5500000000",
  "externalId": "[email protected]_111",
  "callback": "https://webhook/111",
  "id": "1122334455",
  "text": "We are pleased to present our new product: \nThe Amplifier 480xAr 😀",
  "user": "525511111111",
  "extraInfo": {
    "SAMWELL_WEBHOOK_NAME": "Webhook Orders",
    "MSGI_SOURCE_CAMPAIGN": "SKC",
    "contacts": [
      {
        "profile": {
          "name": "Alex Smith"
        },
        "wa_id": "525511111111"
      }
    ]
  }
}
ParameterDescription
ownerThe entity or user who created the automation.
date

Date when the API receives the WhatsApp message status.

The date is represented with date in UTC Zulu format: (yyyy-mm-dd-Thh:mm:ss.ssZ).

processIdUnique identifier of the process (event).
originPhone number used to originate and send the WhatsApp message.
externalIdAn alphanumeric identifier used to identify your WhatsApp messages uniquely for reporting purposes.
callbackWebhook URL to notify about the events of the WhatsApp message.
idUnique identifier provided by META
text

Content of the WhatsApp message sent by the end user.

In case the sent message does not support META, it will display the following message value:

"text": "The message type is not currently supported by META"

userPhone number of the end user.
extraInfoAdditional information sent by the end user from the WhatsApp application.
extraInfo.SAMWELL_WEBHOOK_NAMEWebhook name you typed when setting up the Keyword automation.
extraInfo.MSGI_SOURCE_CAMPAIGNType of automation from which the message is received.
  • "SKC": Keyword automation.
extraInfo.contactsEnd user information.
extraInfo.contacts.profileEnd user profile
extraInfo.contacts.profile.nameName of the end user.
extraInfo.contacts.wa_idPhone number of the end user.
  • Sticker
{
  "owner": "[email protected]",
  "date": "2023-12-12T18:58:44.819365532Z",
  "processId": 2222,
  "origin": "5500000000",
  "externalId": "[email protected]_111",
  "callback": "https://webhook/111",
  "id": "1122334455",
  "text": "",
  "user": "525511111111",
  "extraInfo": {
    "SAMWELL_WEBHOOK_NAME": "Webhook Orders",
    "MSGI_SOURCE_CAMPAIGN": "SKC",
    "sticker": {
      "fileName": "121212_File.webp",
      "shaData": "234567898765434567",
      "url": "https://whatsapp-mo-attachments.awsDomain.com/121212_File",
      "caption": ""
    },
    "contacts": [
      {
        "profile": {
          "name": "Alex Smith"
        },
        "wa_id": "525511111111"
      }
    ]
  }
}
ParameterDescription
ownerThe entity or user who created the automation.
date

Date when the API receives the WhatsApp message status.

The date is represented with date in UTC Zulu format: (yyyy-mm-dd-Thh:mm:ss.ssZ).

processIdUnique identifier of the process (event).
originPhone number used to originate and send the WhatsApp message.
externalIdAn alphanumeric identifier used to identify your WhatsApp messages uniquely for reporting purposes.
callbackWebhook URL to notify about the events of the WhatsApp message.
idUnique identifier provided by META
text

Content of the WhatsApp message sent by the end user.

In case the sent message does not support META, it will display the following message value:

"text": "The message type is not currently supported by META"

userPhone number of the end user.
extraInfoAdditional information sent by the end user from the WhatsApp application.
extraInfo.SAMWELL_WEBHOOK_NAMEWebhook name you typed when setting up the Keyword automation.
extraInfo.MSGI_SOURCE_CAMPAIGNType of automation from which the message is received.
  • "SKC": Keyword automation.
extraInfo.stickerSticker information
extraInfo.sticker.fileNameName of the sticker
extraInfo.sticker.shaData

Optional.

Verify if the sticker is secure according to Secure Hash Algorithms (SHA).

extraInfo.sticker.urlURL of a sticker sent in a WhatsApp message.
extraInfo.contactsEnd user information.
extraInfo.contacts.profileEnd user profile
extraInfo.contacts.profile.nameName of the end user.
extraInfo.contacts.wa_idPhone number of the end user.
  • Image or PDF file attachment
{
  "owner": "[email protected]",
  "date": "2023-12-12T18:58:44.819365532Z",
  "processId": 2222,
  "origin": "5500000000",
  "externalId": "[email protected]_111",
  "callback": "https://webhook/111",
  "id": "1122334455",
  "text": "",
  "user": "525511111111",
  "extraInfo": {
    "SAMWELL_WEBHOOK_NAME": "Webhook Orders",
    "MSGI_SOURCE_CAMPAIGN": "SKC",
    "attachments": [
      {
        "fileName": "14444_File.pdf",
        "shaData": "234567898765434567",
        "url": "https://whatsapp-mo-attachments.awsDomain.com/14444_File",
        "caption": ""
      }
    ],
    "contacts": [
      {
        "profile": {
          "name": "Alex Smith"
        },
        "wa_id": "525511111111"
      }
    ]
  }
}
ParameterDescription
ownerThe entity or user who created the automation.
date

Date when the API receives the WhatsApp message status.

The date is represented with date in UTC Zulu format: (yyyy-mm-dd-Thh:mm:ss.ssZ).

processIdUnique identifier of the process (event).
originPhone number used to originate and send the WhatsApp message.
externalIdAn alphanumeric identifier used to identify your WhatsApp messages uniquely for reporting purposes.
callbackWebhook URL to notify about the events of the WhatsApp message.
idUnique identifier provided by META
text

Content of the WhatsApp message sent by the end user.

In case the sent message does not support META, it will display the following message value:

"text": "The message type is not currently supported by META"

userPhone number of the end user.
extraInfoAdditional information sent by the end user from the WhatsApp application.
extraInfo.SAMWELL_WEBHOOK_NAMEWebhook name you typed when setting up the Keyword automation.
extraInfo.MSGI_SOURCE_CAMPAIGNType of automation from which the message is received.
  • "SKC": Keyword interactive automation.
extraInfo.attachmentsAttachment files information.
extraInfo.attachments.fileNameFile name and type.
extraInfo.attachments.shaData

Optional.

Verify if the file is secure according to Secure Hash Algorithms (SHA).

extraInfo.attachments.urlURL of the image or pdf file sent in a WhatsApp message.
extraInfo.contactsEnd user information.
extraInfo.contacts.profileEnd user profile
extraInfo.contacts.profile.nameName of the end user.
extraInfo.contacts.wa_idPhone number of the end user.
  • Location
{
  "owner": "[email protected]",
  "date": "2023-12-12T18:58:44.819365532Z",
  "processId": 2222,
  "origin": "5500000000",
  "externalId": "[email protected]_111",
  "callback": "https://webhook/111",
  "id": "1122334455",
  "text": "",
  "user": "525511111111",
  "extraInfo": {
    "SAMWELL_WEBHOOK_NAME": "Webhook Orders",
    "MSGI_SOURCE_CAMPAIGN": "SKC",
    "location": {
      "longitude": "-99.140907",
      "latitude": "19.435156",
      "name": null,
      "address": null
    },
    "contacts": [
      {
        "profile": {
          "name": "Alex Smith"
        },
        "wa_id": "525511111111"
      }
    ]
  }
}
ParameterDescription
ownerThe entity or user who created the automation.
date

Date when the API receives the WhatsApp message status.

The date is represented with date in UTC Zulu format: (yyyy-mm-dd-Thh:mm:ss.ssZ).

processIdUnique identifier of the process (event).
originPhone number used to originate and send the WhatsApp message.
externalIdAn alphanumeric identifier used to identify your WhatsApp messages uniquely for reporting purposes.
callbackWebhook URL to notify about the events of the WhatsApp message.
idUnique identifier provided by META
text

Content of the WhatsApp message sent by the end user.

In case the sent message does not support META, it will display the following message value:

"text": "The message type is not currently supported by META"

userPhone number of the end user.
extraInfoAdditional information sent by the end user from the WhatsApp application.
extraInfo.SAMWELL_WEBHOOK_NAMEWebhook name you typed when setting up the Keyword automation.
extraInfo.MSGI_SOURCE_CAMPAIGNType of interactive automation from which the message is received.
  • "SKC": Keyword interactive automation.
extraInfo.locationLocation information.
extraInfo.location.longitudeLongitude of the location.
extraInfo.location.latitudeLatitude of the location.
extraInfo.location.nameName of the location.
extraInfo.location.adressAddress of the location.
extraInfo.contactsEnd user information.
extraInfo.contacts.profileEnd user profile
extraInfo.contacts.profile.nameName of the end user.
extraInfo.contacts.wa_idPhone number of the end user.
  • Contact information
{
  "owner": "[email protected]",
  "date": "2023-12-12T18:58:44.819365532Z",
  "processId": 2222,
  "origin": "5500000000",
  "externalId": "[email protected]_111",
  "callback": "https://webhook/111",
  "id": "1122334455",
  "text": "",
  "user": "525511111111",
  "extraInfo": {
    "SAMWELL_WEBHOOK_NAME": "Webhook Orders",
    "MSGI_SOURCE_CAMPAIGN": "SKC",
    "contact": [
      {
        "name": {
          "first_name": "Julian",
          "middle_name": "Doe",
          "last_name": "Miller",
          "formatted_name": ""
        },
        "phones": [
          {
            "phone": "+525533333333",
            "type": "Celular",
            "wa_id": "525533333333"
          }
        ]
      }
    ],
    "contacts": [
      {
        "profile": {
          "name": "Alex Smith"
        },
        "wa_id": "525511111111"
      }
    ]
  }
}
ParameterDescription
ownerThe entity or user who created the automation.
date

Date when the API receives the WhatsApp message status.

The date is represented with date in UTC Zulu format: (yyyy-mm-dd-Thh:mm:ss.ssZ).

processIdUnique identifier of the process (event).
originPhone number used to originate and send the WhatsApp message.
externalIdAn alphanumeric identifier used to identify your WhatsApp messages uniquely for reporting purposes.
callbackWebhook URL to notify about the events of the WhatsApp message.
idUnique identifier provided by META
text

Content of the WhatsApp message sent by the end user.

In case the sent message does not support META, it will display the following message value:

"text": "The message type is not currently supported by META"

userPhone number of the end user.
extraInfoAdditional information sent by the end user from the WhatsApp application.
extraInfo.SAMWELL_WEBHOOK_NAMEWebhook name you typed when setting up the Keyword automation.
extraInfo.MSGI_SOURCE_CAMPAIGNType of automation from which the message is received.
  • "SKC": Keyword automation.
extraInfo.contactContact information.
extraInfo.contact.nameAn array containing contact information.
extraInfo.contact.name.first_nameFirst name of the contact.
extraInfo.contact.name.middle_nameMiddle name of the contact.
extraInfo.contact.name.last_nameLast name of the contact.
extraInfo.contact.name.formatted_name
extraInfo.contact.phonesPhone number information of the contact.
extraInfo.contact.phones.phonePhone number of the contact.
extraInfo.contact.phones.typeType of phone number
extraInfo.contact.phones.wa_idPhone number of the contact.
extraInfo.contactsEnd user information.
extraInfo.contacts.profileEnd user profile
extraInfo.contacts.profile.nameName of the end user.
extraInfo.contacts.wa_idPhone number of the end user.