Outgoing messages#
This section describes the general format of incoming webhooks with the outgoingMessageReceived and outgoingAPIMessageReceived types. Description of all incoming webhooks types is given in Incoming webhooks types section.
The system provides for receiving notifications about outgoing messages of the below types:
- Outgoing message status
- Outgoing message via API
- Outgoing text message
- Outgoing image, video, audio, document message
- Outgoing template message
outgoingMessageReceived webhook parameters#
| Parameter | Type | Description |
|---|---|---|
typeWebhook | string | Incoming webhook type. For a webhook of this type, the parameter takes on the value outgoingMessageReceived |
instanceData | object | Instance data |
timestamp | integer | Event timestamp in UNIX format |
idMessage | string | Sent message Id |
senderData | object | Message or file sender data |
messageData | object | Sent message or file data |
instanceData object parameters
| Parameter | Type | Description |
|---|---|---|
idInstance | integer | Instance Id. The integer size is int64. Values range from 1 to 10 digits |
wid | string | Account Id in WhatsApp format* |
typeInstance | string | Instance messenger type |
senderData object parameters
| Parameter | Type | Description |
|---|---|---|
chatId | string | Chat Id, where a message or file has been sent |
sender | string | Message or file sender Id |
chatName | string | Chat name |
senderName | string | Sender name |
senderContactName | string | Sender name from the phone book contact list |
messageData object parameters#
messageData object has different parameters depending on sent message type:
- Outgoing message via API
- Outgoing text message
- Outgoing image, video, audio, document message
- Outgoing template message
Webhook body example#
{
"typeWebhook": "outgoingMessageReceived",
"instanceData": {
"idInstance": 1101111111,
"wid": "79876543210@c.us",
"typeInstance": "whatsapp"
},
"timestamp": 1588091580,
"idMessage": "F7AEC1B7086ECDC7E6E45923F5EDB825",
"senderData": {
"chatId": "79001234567@c.us",
"sender": "79876543210@c.us",
"chatName": "GREEN-API",
"senderName": "GREEN-API",
"senderContactName": "GREEN-API"
},
"messageData":{
// Depending on typeMessage = textMessage || imageMessage || videoMessage || documentMessage || audioMessage || locationMessage || contactMessage
...
...
...
}
}