Incoming call#
A webhook of this type appears when there is an incoming call and contains information about the initiator and recipient of the call.
Webhook#
Webhook parameters#
Parameter | Type | Description |
---|---|---|
from | string | Call initiator Id |
typeWebhook | string | Incoming webhook type. For webhooks of this type the parameter takes on the value incomingCall |
instanceData | object | Account data |
status | string | The status of an incoming call, it takes the following values: |
offer - incoming call | ||
pickUp - answered incoming call | ||
hangUp - unanswered incoming call | ||
missed - missed, unanswered incoming call, the connection was interrupted by the initiator | ||
declined - declined, unanswered incoming call, connection was interrupted by WhatsApp | ||
timestamp | integer | Event timestamp in UNIX format |
idMessage | string | Incoming call Id |
instanceData
object parameters
Parameter | Type | Description |
---|---|---|
idInstance | integer | Account Id |
wid | string | Account Id in WhatsApp format |
typeInstance | string | Account messenger type |
Call statuses
When an incoming call is received, the system generates two notifications in sequence:
- The first notification with the status
offer
, indicating that a new incoming call has been received. - Second notification with status
pickUp
,hangUp
,missed
ordeclined
, depending on the outcome of the call.
Scenario for receiving notifications:
offer
+pickUp
- successful incoming call, the recipient answered the calloffer
+hungUp
- incoming call not answered, the recipient has interrupted the connection or the “Do not disturb” function has been activated on the phone (hung up)offer
+missed
- missed incoming call, the initiator interrupted the connection (the caller ended the call)offer
+declined
- missed incoming call, the application terminated the connection due to a timeout (Whatsapp ended the call)
Webhook body example#
{
"from": "79001234500@c.us",
"typeWebhook": "incomingCall",
"instanceData": {
"idInstance": 1234,
"wid": "11001234567@c.us",
"typeInstance": "whatsapp"
},
"status": "pickUp",
"timestamp": 1617691757,
"idMessage": "104179EDB7F5328988D8834107EEBE50"
}