Skip to content

Incoming text message#

This section describes messageData object incoming webhook format for an incoming text message. For a description of the general format of incoming webhooks, refer to Incoming messages section.

To get incoming webhooks of this type, two conditions must be true:

typeWebhook = incomingMessageReceived

messageData.typeMessage = textMessage

Instance settings

To receive incoming webhooks about incoming messages, you need to enable the settings in one of the following ways:

  1. Enable the Receive notifications about incoming messages and files setting via the console

  2. Enable the incomingWebhook setting via the SetSettings method

Webhook#

Webhook parameters#

messageData object parameters

Parameter Type Description
typeMessage string Received message type. For messages of this type, the parameter takes on the value textMessage
textMessageData object Text message data object

textMessageData object parameters

Parameter Type Description
textMessage string Text message
isTemplateMessage boolean Deprecated. The flag indicates whether the message was generated from a template

The rest of the fields are filled depending on the type of the quoted message and are identical to the fields of incoming messages described in Incoming messages section

Webhook body example#

{
  "typeWebhook": "incomingMessageReceived",
  "instanceData": {
    "idInstance": 1234,
    "wid": "11001234567@c.us",
    "typeInstance": "whatsapp"
  },
  "timestamp": 1588091580,
  "idMessage": "F7AEC1B7086ECDC7E6E45923F5EDB825",
  "senderData": {
    "chatId": "79001234568@c.us",
    "chatName": "GREEN-API",
    "sender": "79001234568@c.us",
    "senderName": "GREEN-API",
    "senderContactName": "GREEN-API"
  },
  "messageData": {
    "typeMessage": "textMessage",
    "textMessageData": {
      "textMessage": "I use GREEN-API to send this message to you!"
    }
  }
}