Incoming message with an image #
This section describes the format of the incoming notification messageData object for an incoming message with an image. 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=imageMessage
Instance settings
To receive incoming notifications about messages with an image, video, audio or document, 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: imageMessage |
fileMessageData | object | Object with data about the received file |
Fields of the fileMessageData object
| Parameter | Type | Description |
|---|---|---|
downloadUrl | string | Link for downloading the file |
caption | string | Caption under the image or video |
fileName | string | File name. |
jpegThumbnail | string | Image preview in base64 |
mimeType | string | File type, according to the Media Types classification |
forwardingScore | integer | Number of times the message has been forwarded |
isForwarded | boolean | Flag of a forwarded message, true/false |
Notification body example#
Example of a notification body for a message with an image from a personal chat#
{
"typeWebhook": "incomingMessageReceived",
"instanceData": {
"idInstance": 4100000000,
"wid": "79876543210@c.us",
"typeInstance": "telegram"
},
"timestamp": 1763115112,
"idMessage": "1763115112345",
"senderData": {
"chatId": "10000000",
"chatType": "user",
"sender": "10000000",
"chatName": "Vasilisa the Wise",
"senderName": "Vasilisa the Wise",
"senderType": "user",
"senderContactName": "Vasilisa the Wise",
"senderPhoneNumber": 79998887766
},
"messageData": {
"typeMessage": "imageMessage",
"fileMessageData": {
"downloadUrl": "https://4100.api.green-api.com/download/4100/15697d2c-397c-4fd0-8e1a-8be95f753aae.webp",
"caption": "",
"fileName": "1769056990.jpg",
"jpegThumbnail": "UklGRjoAAABXRUJQVlA4IC4AAACwAwCdASoyADIAPm0skkYkIqGhLggAgA2JaQAAZAEm0xUUDzF5wAD++yGAAAAA",
"isAnimated": false,
"mimeType": "image/jpg",
"forwardingScore": 0,
"isForwarded": false
}
}
}
Example of a notification body for a message with an image from a group chat#
{
"typeWebhook": "incomingMessageReceived",
"instanceData": {
"idInstance": 4100000000,
"wid": "79876543210@c.us",
"typeInstance": "telegram"
},
"timestamp": 1763115112,
"idMessage": "1763115112345",
"senderData": {
"chatId": "-10000000000000",
"chatType": "channel",
"sender": "10000000",
"chatName": "Faraway Kingdom",
"senderName": "Vasilisa",
"senderType": "user",
"senderContactName": "",
"senderPhoneNumber": 0
},
"messageData": {
"typeMessage": "imageMessage",
"fileMessageData": {
"downloadUrl": "https://4100.api.green-api.com/download/4100/15697d2c-397c-4fd0-8e1a-8be95f753aae.webp",
"caption": "",
"fileName": "1769056990.jpg",
"jpegThumbnail": "UklGRjoAAABXRUJQVlA4IC4AAACwAwCdASoyADIAPm0skkYkIqGhLggAgA2JaQAAZAEm0xUUDzF5wAD++yGAAAAA",
"isAnimated": false,
"mimeType": "image/jpg",
"forwardingScore": 0,
"isForwarded": false
}
}
}