Webhooks

A webhook is a means to receive information when an event occurs. It typically involves providing a url that the webhook provider will POST information to every time the event is observed to take place.

Configuring webhooks is done via the webhooks screen.

Webhooks

Endpoints

URLs

Endpoint URLs are provided by the customer and must be HTTPS.

Verification

An endpoint URL must return the Secret Key shown on the screen next to the chosen event.

Secrets are returned as text.

Testing

Testing webhooks is easy. Every possible sub event and payload is availble for testing to ensure that your callbacks work exactly as you want

Events

OnInit

OnInit delivers information about an incoming call for every incoming call. Every callback looks the same and has the same information. The system does not know what the customer is going to do before the customer does it.

Payload
{
    "dnis": "+912067930037",
    "call_direction": "INCOMING",
    "recording_type": null,
    "start": "2021-01-12T12:51:46.282",
    "end": null,
    "duration": null,
    "ivr_number": "+912067930037",
    "caller_id": "+919586773322",
    "sessionid": "9b70a8de06d9e99d501cb8f91c66ccfe",
    "wrong_input_count": null,
    "noinput_count": null,
    "selection": null
}

OnWrapup

OnWrapUp delivers information about a call information after it has ended. Different selections by the caller results in different payloads being returned to the callback URL. The various payload data are enumerated below.

Voicemail
{
    "dnis": "+912067930037",
    "call_direction": "INCOMING",
    "recording_type": "Voicemail",
    "start": "2020-12-17T16:03:25.491",
    "end": "2020-12-17T16:03:44.903",
    "duration": "00:00:19",
    "ivr_number": "+912067930037",
    "caller_id": "+919021703770",
    "sessionid": "a7653fc8778e9dae4d3aa4eba4c8495f",
    "wrong_input_count": 0,
    "noinput_count": 0,
    "selection": 2,
    "vm_msg_url": "/api/cdr/a7653fc8778e9dae4d3aa4eba4c8495f/recording/",
    "action": "voicemail"
}
Agent Transfer
{
    "dnis": "+912067930037",
    "call_direction": "INCOMING",
    "recording_type": "Call",
    "start": "2020-11-20T17:13:12.423",
    "end": "2020-11-20T17:14:01.057",
    "duration": "00:00:48",
    "ivr_number": "+912067930037",
    "caller_id": "+919021703770",
    "sessionid": "7a7329ec9d25091981c113e1c6c2a232",
    "wrong_input_count": 0,
    "noinput_count": 0,
    "selection": 3,
    "recording_url": "/api/cdr/7a7329ec9d25091981c113e1c6c2a232/recording/",
    "action": "xfer"
}
DTMF (Numeric) Input
{
    "dnis": "+912235458437",
    "call_direction": "INCOMING",
    "recording_type": null,
    "start": "2020-12-23T10:02:01.827",
    "end": "2020-12-23T10:02:25.659",
    "duration": "00:00:23",
    "ivr_number": "+912235458437",
    "caller_id": "+919021703770",
    "sessionid": "45ca822d197b5a88c0ed2a0b7e17ff6f",
    "wrong_input_count": 0,
    "noinput_count": 0,
    "selection": 1,
    "dtmf_input": "11112254",
    "dtmf_input_len": "8",
    "dtmf_noinput_count": "0",
    "action": "dtmf"
}
NOOP
{
    "dnis": "+912067930037",
    "call_direction": "INCOMING",
    "recording_type": null,
    "start": "2020-12-17T15:52:13.974",
    "end": "2020-12-17T15:52:29.034",
    "duration": "00:00:15",
    "ivr_number": "+912067930037",
    "caller_id": "+919867221975",
    "sessionid": "3632ff00e06b0dad730973198f5ef2dc",
    "wrong_input_count": 0,
    "noinput_count": 0,
    "selection": 1,
    "action": "email"
}

Example

Sample code on deploying a callback to work with webhooks is available at Github

https://github.com/1e9s/webhook/