Incoming text message or URL message#
This section describes messageData object incoming webhook format for incoming text message with URL. 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 = 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 setting
Receive notifications about incoming messages and files -
Through the SetSettings method enable the setting
incomingWebhook
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 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 |
greetingMessageBody | string | The text of the welcome message that was automatically sent to the user. (Only for advertising messages) |
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 Incoming messages section
Webhook body example#
{
"typeWebhook": "incomingMessageReceived",
"instanceData": {
"idInstance": 7103000000,
"wid": "79876543210@c.us",
"typeInstance": "whatsapp"
},
"timestamp": 1588091580,
"idMessage": "F7AEC1B7086ECDC7E6E45923F5EDB825",
"senderData": {
"chatId": "79001234567@c.us",
"sender": "79001234567@c.us",
"chatName": "John",
"senderName": "John",
"senderContactName": "John Doe"
},
"messageData": {
"typeMessage": "extendedTextMessage",
"extendedTextMessageData": {
"text": "https://green-api.com/docs/video",
"description": "GREEN-API docs show how you can develop the WhatsApp Bot",
"title": "How to develop WhatsApp Bot",
"jpegThumbnail": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYG==",
"forwardingScore": 4,
"isForwarded": true
}
}
}
Message from group chat webhook body example#
{
"typeWebhook": "incomingMessageReceived",
"instanceData": {
"idInstance": 7103000000,
"wid": "79876543210@c.us",
"typeInstance": "whatsapp"
},
"timestamp": 1732268220,
"idMessage": "2D9D6721A977D369246509EBE0CE44CA",
"senderData": {
"chatId": "120363369140947676@g.us",
"chatName": "Group",
"sender": "79001234567@c.us",
"senderName": "John",
"senderContactName": "John Doe"
},
"messageData": {
"typeMessage": "extendedTextMessage",
"extendedTextMessageData": {
"text": "https://green-api.com/docs/video",
"description": "GREEN-API docs show how you can develop the WhatsApp Bot",
"title": "How to develop WhatsApp Bot",
"jpegThumbnail": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYG==",
"forwardingScore": 4,
"isForwarded": true
}
}
}
Link or text and contact quote incoming message webhook body example#
{
"typeWebhook": "incomingMessageReceived",
"instanceData": {
"idInstance": 7103000000,
"wid": "79876543210@c.us",
"typeInstance": "whatsapp"
},
"timestamp": 1588091580,
"idMessage": "F7AEC1B7086ECDC7E6E45923F5EDB825",
"senderData": {
"chatId": "79001234567@c.us",
"sender": "79001234567@c.us",
"senderName": "John",
"senderContactName": "John Doe"
},
"messageData": {
"typeMessage": "quotedMessage",
"extendedTextMessageData": {
"text": "https://yandex.ru/former&utm_source=home&utm_content=main_informer&utm_term=main_number",
"stanzaId": "46618B98B3B9DF50F123456789123456",
"participant": "79001230000@c.us",
"forwardingScore": 4,
"isForwarded": true
},
"quotedMessage": {
"stanzaId": "46618B98B3B9DF50F123456789123456",
"participant": "79061230000@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"
}
}
}
}
Link and image quote incoming message webhook body example#
{
"typeWebhook": "incomingMessageReceived",
"instanceData": {
"idInstance": 7103000000,
"wid": "79876543210@c.us",
"typeInstance": "whatsapp"
},
"timestamp": 1588091580,
"idMessage": "F7AEC1B7086ECDC7E6E45923F5EDB825",
"senderData": {
"chatId": "79001234567@c.us",
"sender": "79001234567@c.us",
"senderName": "John",
"senderContactName": "John Doe"
},
"messageData": {
"typeMessage": "quotedMessage",
"extendedTextMessageData": {
"text": "https://yandex.ru/pogoda/?utm_medium=source=home&utm_content=main_informer&utm_term=main_number",
"stanzaId": "46618B98B3B9DF50F123456789123456",
"participant": "79001230000@c.us",
"forwardingScore": 4,
"isForwarded": true
},
"quotedMessage": {
"stanzaId": "46618B98B3B9DF50F123456789123456",
"participant": "79061230000@c.us",
"typeMessage": "imageMessage",
"downloadUrl": "",
"caption": "",
"jpegThumbnail": ""
}
}
}
Advertising incoming message webhook body example#
{
"typeWebhook": "incomingMessageReceived",
"instanceData": {
"idInstance": 7103000000,
"wid": "79876543210@c.us",
"typeInstance": "whatsapp"
},
"timestamp": 1588091580,
"idMessage": "F7AEC1B7086ECDC7E6E45923F5EDB825",
"senderData": {
"chatId": "79001234567@c.us",
"chatName": "John",
"sender": "79001234567@c.us",
"senderName": "John",
"senderContactName": "John Doe"
},
"messageData": {
"typeMessage": "extendedTextMessage",
"extendedTextMessageData": {
"text": "https://fb.me/gUdvBdhtH",
"description": "Новый инстанс для вашего бизнеса!",
"title": "GREEN-API",
"containsAutoReply": false,
"mediaType": "IMAGE",
"showAdAttribution": false,
"sourceId": "122210486228016873",
"sourceType": "post",
"sourceUrl": "https://fb.me/gUdvBdhtH",
"conversionSource": "FB_Ads",
"entryPointConversionApp": "instagram",
"jpegThumbnail": "/9j/4AAQSkZJRgABAQAAAQABAAD/7QCEUGhvdG9zaG9wIDMuMAA4qIJUeuMEjYwGc9BtFMXTYvgsnm4ADy6HLLZDqn1Ye5RMev+ae1hED2B9dQIARwjvDIwYCg4/r/9k=",
"thumbnailUrl": "https://scontent.xx.fbcdn.net/v/t39.30808-6/436945887_122115998378256688_307643393252141869_n.jpg?stp=dst-jpg_s851x315&_nc_cat=111&ccb=1-7&_nc_sid=5f2048&_nc_ohc=x61r6W-VrJIAb69T4Dl&_nc_ad=z-m&_nc_cid=0&_nc_ht=scontent.xx&oh=00_AfDLFkjNOBYEntBu6SYaUOxDuxbvarjKha9Ez5RQUXjsfg&oe=662D7680",
"previewType": ""
}
}
}
Advertising incoming message of target ad webhook body example#
{
"typeWebhook": "incomingMessageReceived",
"idMessage": "AC814C7E5B3E73AEEEC2FF09DA8613C4",
"instanceData": {
"idInstance": 1101111111,
"wid": "79876543210@c.us",
"typeInstance": "whatsapp"
},
"timestamp": 1785919240,
"senderData": {
"chatId": "79001234567@c.us",
"chatName": "John",
"sender": "79001234567@c.us",
"senderName": "John",
"senderContactName": "John Doe",
"chatName": "John"
},
"messageData": {
"typeMessage": "extendedTextMessage",
"extendedTextMessageData": {
"text": "Hello! Can you tell me more about this?",
"description": "How many clients are you losing while your manager is busy or unable to respond? Connect an AI agent who communicates with clients on WhatsApp 24/7. They instantly answer questions, explain services, accept requests, schedule appointments, and transfer the conversation to a live agent when needed. Benefits: ⚡ Responses in seconds 🌙 24/7 availability 🇰🇿 Popular languages 📊 CRM integration 👨💼 Transfer conversations to a manager Submit a request—we'll tell you how to integrate an AI agent into your business",
"title": "api.whatsapp.com",
"previewType": "None",
"jpegThumbnail": "/9j/4AAQSkZ ... umAf//Z",
"forwardingScore": 0,
"isForwarded": false,
"containsAutoReply": false,
"ctwaClid": "AfjGEOPffRs1gIk5kVWsIphv5wb ... UoO9yw",
"greetingMessageBody": "Welcome! For a consultation, click \"Submit Request.\"",
"mediaType": "IMAGE",
"showAdAttribution": true,
"automatedGreetingMessageShown": true,
"sourceId": "120247824735680330",
"sourceType": "ad",
"sourceApp": "instagram",
"sourceUrl": "https://www.instagram.com/p/DbY5l2MAE4t/",
"originalImageUrl": "https://instagram.ftse3-2.fna.fbcdn.net/ ... =6A79CE3D",
"conversionSource": "FB_Ads",
"entryPointConversionApp": "instagram",
"thumbnailUrl": "https://instagram.ftse3-2.fna.fbcdn.net/ ... =6A79CE3D"
}
}