[go: up one dir, main page]

Skip to content

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.

Configuring an instance

To receive incoming notifications about imcoming calls, you need to enable the settings using one of the following options:

  1. Through console enable the setting Get notifications about calls

  2. Through the SetSettings method enable the setting incomingCallWebhook

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 Instance data
status string The status of an incoming call, it takes the following values:
offer - incoming call
pickUp - answered incoming call
hangUp - the recipient of the incoming call did not pick up the phone and hung up, the “Do not disturb” function is activated on the phone
missed - the call initiator canceled the call
declined - unanswered incoming call
timestamp integer Event timestamp in UNIX format
idMessage string Incoming call Id

instanceData object parameters

Parameter Type Description
idInstance integer Instance Id. The size of the integer is int64. Values ​​range include from 1 to 10 digits
wid string Account Id in WhatsApp format
typeInstance string Instance 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 or declined, depending on the outcome of the call.

Scenario for receiving notifications:

  1. offer + pickUp - successful incoming call, the recipient answered the call
  2. offer + 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)
  3. offer + missed - missed incoming call, the initiator interrupted the connection (the caller ended the call)
  4. 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"
}