Incoming location message#
This section describes messageData object incoming webhook format for an incoming message with a location. 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 = locationMessage
Instance settings
To receive incoming webhooks about messages with a location, you need to enable the settings in one of the following ways:
-
Enable the
Receive notifications about incoming messages and filessetting via the console -
Enable the
incomingWebhooksetting via the SetSettings method
Webhook#
Webhook parameters#
messageData object parameters
| Parameter | Type | Description |
|---|---|---|
typeMessage | string | Received message type. For messages of this type, the parameter takes on the value locationMessage |
locationMessageData | object | Received location data object |
locationMessageData object parameters
| Parameter | Type | Description |
|---|---|---|
nameLocation | string | Location name |
address | string | Location address |
jpegThumbnail | string | Image preview in base64 encoding |
latitude | double | Location latitude |
longitude | double | Location longitude |
forwardingScore | integer | Number of message forwards |
isForwarded | boolean | Whether the message is forwarded, takes the values true/false |
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": 1101111111,
"wid": "79876543210@c.us",
"typeInstance": "whatsapp"
},
"timestamp": 1588091580,
"idMessage": "F7AEC1B7086ECDC7E6E45923F5EDB825",
"senderData": {
"chatId": "79001234568@c.us",
"sender": "79001234568@c.us",
"chatName": "GREEN-API",
"senderName": "GREEN-API",
"senderContactName": "GREEN-API"
},
"messageData": {
"typeMessage": "locationMessage",
"locationMessageData": {
"nameLocation": "Empire State Building",
"address": "20 W 34th St., New York, NY 10001, USA",
"jpegThumbnail": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFx=",
"latitude": 51.103444,
"longitude": 71.4037284,
"forwardingScore": 0,
"isForwarded": false
}
}
}