Skip to content

Outgoing contact message#

This section describes messageData object incoming webhook format for outgoing contact 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 = contactMessage

Configuring an instance

To receive incoming notifications about contact messages, you need to enable the settings using one of the following options:

  1. Through console enable the settings Get notifications about messages sent from API, Get notifications about messages sent from the phone

  2. Through the SetSettings method enable the settings outgoingAPIMessageWebhook and outgoingMessageWebhook

Webhook#

Webhook parameters#

messageData object parameters

Parameter Type Description
typeMessage string incoming webhook type. For messages of this type the parameter takes on the value contactMessage
contactMessageData object Outgoing contact data object.
quotedMessage object Quoted message data object. Present only if the message itself is a quote

contactMessageData object parameters

Parameter Type Description
displayName string Displayed contact name
vcard string VCard structure (contact visit card)
isForwarded boolean
forwardingScore integer

quotedMessage object parameters

Parameter Type Description
stanzaId string quoted message id
participant string quoted message sender's id
typeMessage string quoted message type

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

Webhook body example#

{
  "typeWebhook": "outgoingMessageReceived",
  "instanceData": {
    "idInstance": 7103000000,
    "wid": "79876543210@c.us",
    "typeInstance": "whatsapp"
  },
  "timestamp": 1588091580,
  "idMessage": "3EB0608D6A2901063D63",
  "senderData": {
    "chatId": "79001234567@c.us",
    "sender": "79876543210@c.us",
    "chatName": "Jane",
    "senderName": "John",
    "senderContactName": "John Doe"
  },
  "messageData": {
    "typeMessage": "contactMessage",
    "contactMessageData": {
      "displayName": "Jack Strauber",
      "vcard": "BEGIN:VCARD\nVERSION:3.0\nN:Strauber;Jack;;;\nFN:Jack Strauber\nORG:Image\nTITLE:\nitem1.TEL;waid=79001234569:+7 900 123-45-69\nitem1.X-ABLabel:Mobile\nEND:VCARD",
      "forwardingScore": 4,
      "isForwarded": true
    }
  }
}

Contact message from group chat webhook body example#

{
    "typeWebhook": "outgoingMessageReceived",
    "instanceData": {
        "idInstance": 7103000000,
        "wid": "79876543210@c.us",
        "typeInstance": "whatsapp"
    },
    "timestamp": 1732268220,
    "idMessage": "3EB0608D6A2901063D63",
    "senderData": {
      "chatId": "120363369140947676@g.us",
      "chatName": "Group",
      "sender": "79876543210@c.us",
      "senderName": "John",
      "senderContactName": "John Doe"
  },
  "messageData": {
    "typeMessage": "contactMessage",
    "contactMessageData": {
      "displayName": "Jack Strauber",
      "vcard": "BEGIN:VCARD\nVERSION:3.0\nN:Strauber;Jack;;;\nFN:Jack Strauber\nORG:Image\nTITLE:\nitem1.TEL;waid=79001234569:+7 900 123-45-69\nitem1.X-ABLabel:Mobile\nEND:VCARD",
      "forwardingScore": 4,
      "isForwarded": true
    }
  }
}

Contact and text message quote outgoing message webhook body example#

{
  "typeWebhook": "outgoingMessageReceived",
  "instanceData": {
    "idInstance": 7103000000,
    "wid": "79876543210@c.us",
    "typeInstance": "whatsapp"
  },
  "timestamp": 1588091580,
  "idMessage": "3EB0608D6A2901063D63",
  "senderData": {
    "chatId": "79001234567@c.us",
    "sender": "79876543210@c.us",
    "chatName": "Jane",
    "senderName": "John",
    "senderContactName": "John Doe"
  },
  "messageData": {
    "typeMessage": "contactMessage",
    "contactMessageData": {
      "displayName": "Anti-spam",
      "vcard": "BEGIN:VCARD\nVERSION:3.0\nN:;Anti-spam;;;\nFN:Anti-spam\nitem1.TEL:*9035936232#\nitem1.X-ABLabel:Mobile\nEND:VCARD",
      "forwardingScore": 4,
      "isForwarded": true
    },
    "quotedMessage": {
      "stanzaId": "46618B98B3B9DF50F123456789123456",
      "participant": "79876543210@c.us",
      "typeMessage": "textMessage",
      "textMessage": "Hello"
    }
  }
}

Contact and audio/video/document quote outgoing message webhook body example#

{
  "typeWebhook": "outgoingMessageReceived",
  "instanceData": {
    "idInstance": 7103000000,
    "wid": "79876543210@c.us",
    "typeInstance": "whatsapp"
  },
  "timestamp": 1588091580,
  "idMessage": "3EB0608D6A2901063D63",
  "senderData": {
    "chatId": "79001234567@c.us",
    "sender": "79876543210@c.us",
    "chatName": "Jane",
    "senderName": "John",
    "senderContactName": "John Doe"
  },
  "messageData": {
    "typeMessage": "contactMessage",
    "contactMessageData": {
          "displayName": "Anti-spam",
          "vcard": "BEGIN:VCARD\nVERSION:3.0\nFN:2 Lena\nitem1.TEL;waid=79001230000\nitem1.X-ABLabel:Mobile\nEND:VCARD",
          "forwardingScore": 4,
          "isForwarded": true
    }
    },
    "quotedMessage": {
         "stanzaId": "46618B98B3B9DF50F123456789123456",
         "participant": "79876543210@c.us",
         "typeMessage": "imageMessage",
         "downloadUrl": "",
         "caption": "",
         "jpegThumbnail": ""
    }
  }

Contact and contact quote outgoing message webhook body example#

{
  "typeWebhook": "outgoingMessageReceived",
  "instanceData": {
    "idInstance": 7103000000,
    "wid": "79876543210@c.us",
    "typeInstance": "whatsapp"
  },
  "timestamp": 1588091580,
  "idMessage": "3EB0608D6A2901063D63",
  "senderData": {
    "chatId": "79001234567@c.us",
    "sender": "79876543210@c.us",
    "chatName": "Jane",
    "senderName": "John",
    "senderContactName": "John Doe"
  },
  "messageData": {
    "typeMessage": "contactMessage",
    "contactMessageData": {
      "displayName": "",
      "vcard": "BEGIN:VCARD\nVERSION:3.0\nN:Fond;\nitem1.TEL;waid=79001203030:/em1.X-ABLabel:New type\nEND:VCARD",
      "forwardingScore": 4,
      "isForwarded": true
    },
    "quotedMessage": {
      "stanzaId": "46618B98B3B9DF50F123456789123456",
      "participant": "79876543210@c.us",
      "typeMessage": "contactMessage",
      "contact": {
        "displayName": "Green-Api",
        "vcard": "BEGIN:VCARD\nVERSION:3.0\nN:Green-Api\nitem1.TEL;waid=79001230000\nitem1.X-ABLabel:Mobile\nEND:VCARD"
      }
    }
  }
}

Contact and location quote outgoing message webhook body example#

{
  "typeWebhook": "outgoingMessageReceived",
  "instanceData": {
    "idInstance": 7103000000,
    "wid": "79876543210@c.us",
    "typeInstance": "whatsapp"
  },
  "timestamp": 1588091580,
  "idMessage": "3EB0608D6A2901063D63",
  "senderData": {
    "chatId": "79001234567@c.us",
    "sender": "79876543210@c.us",
    "chatName": "Jane",
    "senderName": "John",
    "senderContactName": "John Doe"
  },
  "messageData": {
    "typeMessage": "contactMessage",
    "contactMessageData": {
      "displayName": "Fond",
      "vcard": "BEGIN:VCARD\nVERSION:3.0\nFN:2 Hearts\nitem1.TEL;waid=79200000102\nitem1.X-ABLabel:New type\nEND:VCARD",
      "forwardingScore": 4,
      "isForwarded": true
    },
    "quotedMessage": {
      "stanzaId": "46618B98B3B9DF50F123456789123456",
      "participant": "79060002233@c.us",
      "typeMessage": "locationMessage",
      "location": {
        "nameLocation": "",
        "address": "",
        "jpegThumbnail": "",
        "latitude": 72.5922702,
        "longitude": 45.6645388
      }
    }
  }
}