Incoming messages#
This section describes the general format of incoming webhooks with the incomingMessageReceived
type. Description of all incoming webhooks types is given in Incoming webhooks types section.
The system provides for receiving notifications about incoming messages of the below types:
- Incoming text message
- Incoming buttons message
- Incoming template buttons message
- Incoming selection list message
- Incoming text message with URL
- Incoming image, video, audio, document message
- Incoming location message
- Incoming contact message
- Incoming message with an array of contacts
- Incoming quoted message
- Incoming message with sticker
- Incoming message-reaction
- Incoming message with an invitation to the group
- Incoming poll message
incomingMessageReceived webhook parameters#
Parameter | Type | Description |
---|---|---|
typeWebhook | string | Incoming webhook type. For a webhook of this type, the paramaeter takes on the value incomingMessageReceived |
instanceData | object | Account data |
timestamp | integer | Event timestamp in UNIX format |
idMessage | string | Incoming message Id |
senderData | object | Message or file sender data |
messageData | object | Received message or file data |
instanceData
object parameters
Parameter | Type | Description |
---|---|---|
idInstance | integer | Account Id |
wid | string | Account Id in WhatsApp format |
typeInstance | string | Account messenger type |
senderData
object parameters
Parameter | Type | Description |
---|---|---|
chatId | string | Chat Id, where a message or file has been received |
sender | string | Message or file sender Id |
chatName | string | chat name |
senderName | string | Sender name |
messageData
object parameters#
messageData
object has different parameters depending on incoming message type:
- Incoming text message
- Incoming text message with URL
- Incoming image, video, audio, document message
- Incoming location message
- Incoming contact message
- Incoming message with an array of contacts
- Incoming quoted message
- Incoming message with sticker
- Incoming message-reaction
- Incoming message with an invitation to the group
- Incoming poll message
Webhook body example#
{
"typeWebhook": "incomingMessageReceived",
"instanceData": {
"idInstance": 1234,
"wid": "11001234567@c.us",
"typeInstance": "whatsapp"
},
"timestamp": 1588091580,
"idMessage": "F7AEC1B7086ECDC7E6E45923F5EDB825",
"senderData": {
"chatId": "79001234568@c.us",
"sender": "79001234568@c.us",
"chatName": "Green API",
"senderName": "Green API"
},
"messageData":{
// Depending on typeMessage = textMessage || imageMessage || videoMessage || documentMessage || audioMessage || locationMessage || contactMessage || extendedTextMessage || quotedMessage || pollCreationMessage
...
...
...
}
}
}