Get notification
Receives one notification from the queue
Function GetNotification(Val AccessParameters, Val Timeout = 5) Export
| Parameter | CLI option | Type | Required | Description |
|---|---|---|---|---|
| AccessParameters | --access | Structure Of KeyAndValue | ✔ | Access parameters. See FormAccessParameters |
| Timeout | --timeout | Number | ✖ | Timeout 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);
- Bash
- CMD/Bat
# 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':'***'}"
:: 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",
"instanceData": {
"idInstance": 7105187566,
"wid": "1234567890@c.us",
"typeInstance": "whatsapp"
},
"timestamp": 1761846799,
"idMessage": "BAE5506506B24B5B",
"senderData": {
"chatId": "120363410406221140@g.us",
"chatName": "",
"sender": "1234567890@c.us",
"senderName": "",
"senderContactName": ""
},
"messageData": {
"typeMessage": "imageMessage",
"fileMessageData": {
"downloadUrl": "https://do-media-7105.fra1.digitaloceanspaces.com/7105187566/2e17faa5-2e49-4b98-b76a-d463b8911292.jpg",
"caption": "File description",
"fileName": "2e17faa5-2e49-4b98-b76a-d463b8911292.jpg",
"jpegThumbnail": "",
"isAnimated": false,
"mimeType": "image/jpeg",
"forwardingScore": 0,
"isForwarded": false
}
}
}
}