Skip to content

Incoming contact message#

This section describes messageData object incoming webhook format for an incoming message with a contact. 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 = contactMessage

Instance settings

To receive incoming webhooks about messages with a contact, 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 contactMessage
contactMessageData object Received contact data object.

contactMessageData object parameters

Parameter Type Description
displayName string Contact display name
vcard string VCard structure (contact business card)

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": 1101111111,
    "wid": "79876543210@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": "contactMessage",
    "contactMessageData": {
      "displayName": "GREEN-API",
      "vcard": "BEGIN:VCARD\nVERSION:3.0\nN:undefined;;;\nFN:GREEN-API\nORG:Image\nTITLE:\nitem1.TEL;waid=79001234567:+7 900 123-45-69\nitem1.X-ABLabel:Mobile\nEND:VCARD"
    }
  }
}