Skip to content

Outgoing text message#

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

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

typeWebhook = outgoingMessageReceived || outgoingAPIMessageReceived

messageData.typeMessage = textMessage

Instance settings

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

  1. Enable the Receive notifications about messages sent from a phone and Receive notifications about messages sent from API settings via the console
    (additionally Receive notifications about the statuses of sent messages to receive webhooks about sent message statuses)

  2. Enable the outgoingMessageWebhook and outgoingAPIMessageWebhook settings via the SetSettings method
    (additionally outgoingWebhook to receive webhooks about sent message statuses)

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 identical to the fields of outgoing messages described in Outgoing messages section

Webhook body example#

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