Incoming text message, message with a URL#
This section describes the format of the incoming notification messageData object for an incoming text message or a message with a URL. For a description of the general format of incoming notifications, refer to the Incoming messages section.
To receive incoming notifications of this kind, two conditions must be met:
typeWebhook=incomingMessageReceivedmessageData.typeMessage=extendedTextMessage
Instance settings
To receive incoming notifications about incoming messages with a URL or advertising messages, you need to enable the settings in one of the ways presented:
-
Through the console, enable the
Receive notifications about incoming messages and filessetting -
Through the SetSettings method, enable the
incomingWebhooksetting
Notification#
Notification format#
Fields of the messageData object
| Parameter | Type | Description |
|---|---|---|
typeMessage | string | Type of the received message. For messages of this type the field takes the value extendedTextMessage |
extendedTextMessageData | object | Object with data about the received text message or link URL |
Fields of the extendedTextMessageData object
| Parameter | Type | Description |
|---|---|---|
text | string | Link text or plain text |
description | string | Link description, may be empty |
title | string | Link title, may be empty |
sourceId | string | Ad id (only for advertising messages) |
jpegThumbnail | string | Image preview in base64 encoding, may be absent |
thumbnailUrl | string | Link to the image preview (only for advertising messages) |
isForwarded | boolean | Whether the message is forwarded, takes the values true/false |
forwardingScore | integer | Number of times the message has been forwarded |
The remaining fields are filled in depending on the type of the quoted message and are identical to the fields of the incoming messages described in the Incoming messages section
Notification body example#
{
"typeWebhook": "incomingMessageReceived",
"instanceData": {
"idInstance": 4100000000,
"wid": "79876543210@c.us",
"typeInstance": "telegram"
},
"timestamp": 1770351383,
"idMessage": "1763115112345",
"senderData": {
"chatId": "10000000",
"chatType": "user",
"sender": "10000000",
"chatName": "Vasilisa",
"senderName": "Vasilisa the Wise",
"senderType": "user",
"senderContactName": "Vasilisa the Wise",
"senderPhoneNumber": 79998887766
},
"messageData": {
"typeMessage": "extendedTextMessage",
"extendedTextMessageData": {
"text": "I use GREEN-API to send this message! The documentation is on the website https://green-api.com/",
"description": "GREEN-API docs shows how you can develop the Telegram Bot",
"title": "How to develop Telegram Bot",
"jpegThumbnail": "UklGRjoAAABXRUJQVlA4IC4AAACwAwCdASoyADIAPm0skkYkIqGhLggAgA2JaQAAZAEm0xUUDzF5wAD++yGAAAAA"
}
}
}