Outgoing text message or URL message#
This section describes messageData object incoming webhook format for outgoing text message with URL. 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 = extendedTextMessage
Configuring an instance
To receive incoming notifications about extended text messages, you need to enable the settings using one of the following options:
-
Through console enable the settings
Receive notifications about messages sent from API,Receive notifications about messages sent from the phoneandReceive notifications about edited messages. -
Through the SetSettings method enable the settings
outgoingAPIMessageWebhook,outgoingMessageWebhookandeditedMessageWebhook.
Webhook#
Webhook parameters#
messageData object parameters
| Parameter | Type | Description |
|---|---|---|
typeMessage | string | outgoing webhook type. For messages of this type, the parameter takes on the value extendedTextMessage |
extendedTextMessageData | object | Data object on incoming link with meta-data |
quotedMessage | object | Quoted message data object. Present only if the message itself is a quote |
extendedTextMessageData object parameters
| Parameter | Type | Description |
|---|---|---|
text | string | Link text or ordinary text |
description | string | Link description, may be empty |
title | string | Link title, may be empty |
containsAutoReply | boolean | Whether the message contains an auto reply (only for advertisement messages) |
mediaType | string | Message media type, for example "IMAGE" (only for advertisement messages) |
showAdAttribution | boolean | Whether the advertisement details should be shown (only for advertisement messages) |
sourceId | string | Advertisement Id (only for advertisement messages) |
sourceType | string | Source type, for example "ad" (only for advertisement messages) |
sourceUrl | string | Advertisement url (only for advertisement messages) |
conversionSource | string | Message localization (only for advertising messages) |
entryPointConversionApp | string | Message source ( only for advertising messages) |
jpegThumbnail | string | base64-coded image preview, may be absent |
thumbnailUrl | string | Image preview url (only for advertisement messages) |
isForwarded | boolean | Whether the message is forwarded, takes on values true/false |
forwardingScore | integer | Number of message forwards |
previewType | string | Preview type (only for advertisement messages) previewType:None value is deprecated |
ctwaClid | string | Click to WhatsApp ad conversion ID. Used to associate the conversation with the ad campaign (only for advertisement messages) |
automatedGreetingMessageShown | boolean | Indicates whether the user was shown an automated greeting message (only for advertisement messages) |
sourceApp | string | The app from which the interaction with WhatsApp was initiated: for example, Facebook, Instagram, or another Meta app. (only for advertisement messages) |
originalImageUrl | string | The original link to the image associated with the ad. (only for advertisement messages) |
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 incoming messages described in Outgoing messages section
Webhook body example#
Advertising outgoing message of target ad webhook body example#
{
"typeWebhook": "outgoingMessageReceived",
"idMessage": "3AC3BB68475D6EC5BBD1",
"instanceData": {
"idInstance": 1101000001,
"wid": "79876543210@c.us",
"typeInstance": "whatsapp"
},
"timestamp": 1785992892,
"senderData": {
"chatId": "71234567890@c.us",
"sender": "79876543210@c.us",
"senderName": "John",
"senderContactName": "John Doe",
"chatName": "Jane"
},
"messageData": {
"typeMessage": "extendedTextMessage",
"extendedTextMessageData": {
"text": "Hello! I would like to place an order.",
"description": ":thinking_face:Thinking about what to choose today?\n\Chat with clients in the best messenger on Earth.\nSales managers are ready to answer you.\n:mailto: support@green-api.com",
"title": "Write to us",
"previewType": "None",
"jpegThumbnail": "",
"forwardingScore": 0,
"isForwarded": false,
"containsAutoReply": false,
"ctwaClid": "Afh6oztQClFhp ... bjQ",
"greetingMessageBody": "Hello! We are happy to help you!",
"mediaType": "VIDEO",
"showAdAttribution": true,
"automatedGreetingMessageShown": true,
"sourceId": "120252186701100169",
"sourceType": "ad",
"sourceApp": "instagram",
"sourceUrl": "https://www.instagram.com/p/187 ... xWK/",
"originalImageUrl": "https://instagram.ftse3-2.fna.fbcdn.net/ ... =6A79CE3D",
"entryPointConversionApp": "instagram",
"thumbnailUrl": "https://instagram.ftse3-2.fna.fbcdn.net/ ... =6A79CE3D"
}
}
}