Skip to main content

Get notification

Receives one notification from the queue

Function GetNotification(Val AccessParameters, Val Timeout = 5) Export

ParameterCLI optionTypeRequiredDescription
AccessParameters--accessStructure Of KeyAndValueAccess parameters. See FormAccessParameters
Timeout--timeoutNumberTimeout for waiting for new messages when the queue is empty
Returns

Map Of KeyAndValue - serialized JSON response from Green API

tip

Once the notification has been successfully accepted, you must remove it from the queue using the DeleteNotificationFromQueue method

Method at API documentation: ReceiveNotification


1C:Enterprise/OneScript code example
ApiUrl = "https://7105.api.greenapi.com";
MediaUrl = "https://7105.media.greenapi.com";
IdInstance = "71051...";
ApiTokenInstance = "425010d90e114aa6b78f0969e...";

AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
Result = OPI_GreenAPI.GetNotification(AccessParameters);
# JSON data can also be passed as a path to a .json file

oint greenapi GetNotification \
--access "{'apiUrl':'***','mediaUrl':'https://7105.media.greenapi.com','idInstance':'7105187566','apiTokenInstance':'***'}"
Result
{
"receiptId": 1,
"body": {
"typeWebhook": "outgoingAPIMessageReceived",
"idMessage": "3EB0C4BC7A0C3E38706799",
"instanceData": {
"idInstance": "***",
"wid": "***",
"typeInstance": "whatsapp"
},
"timestamp": 1779719690,
"senderData": {
"chatId": "***",
"sender": "***",
"senderName": "***",
"senderContactName": "***",
"chatName": "***"
},
"messageData": {
"typeMessage": "extendedTextMessage",
"extendedTextMessageData": {
"text": "New message",
"description": "",
"title": "",
"previewType": "None",
"jpegThumbnail": "",
"forwardingScore": 0,
"isForwarded": false
}
}
}
}