Call Webhook

When making calls through voicehub platform, widget or API, voicehub allows for sending callbacks to your backend to help you track call status, call recordings and call analysis.

Configuring Webhook through Voicehub

In voicehub, each agent can be configured to send webhook requests per calls. This configuration can be found under API Sidebar menu item as in the next screenshot

In the configuration of webhook, you will have multiple options that need to be configured for the webhook.

  1. Webhook URL: This is the endpoint url that the webhook will send POST requests to on your end.

  2. Secret: This is any secret key you want to be used for verifying webhook requests. It will be sent through a header on the post request x-webhook-secret

  3. Retrying attempts and delays: Requests will be retired couple of times to your end points with delays in milliseconds sepcified in the fields

  4. Request timeout also is configurable

Events sent through call webhook

Currently, voicehub triggers three different types of events through the lifecycle of a call.

CallStatusChanged

This event is triggered whenever a change happens to your call status. The payload of the post body contains the following jsonized string, the expected call statuses are listed below

{
      eventType: WebhookEventType.CallStatusChanged,
      timestamp: "Date iso string when event happened",
      eventId: "Unique event Id",
      status: "new call status",
      callId: "call id",
}

For call statuses that are returned from the API, you can expect one of the following

started -> When right when the call is connected
queued -> When call is waiting to be started.
completed -> when call completes
in-progress -> When call is being in progress (user/agent are talking)
failed -> Call failed due to some reason
cancelled -> Call is canceled
unanswered -> If call is not answered
scheduled -> If call request had the schedule At parameter so that it is scheduled for a later time.
busy -> If user is busy
voicemail -> If call is forwarded to voicemail

RecordingsAvailable

This event is triggered upong having the call voice recordings available. The body of the payload is

{
  eventType: WebhookEventType.RecordingsAvailable,
  timestamp: "Date iso string when event happened",
  eventId: "Unique event Id",
  callId: "call id",
}

AnalysisResultReady

This event is triggered whenever the analysis of the call is available. Callback payload contains a link to fetch the results. Beware that the result request requires using the API Key as a header x-dq-api-key

{
  eventType: WebhookEventType.AnalysisResultReady,
  analysisId: "Analysis Id",
  timestamp: "Date iso string when event happened",
  eventId: "Unique event Id",
  callId: "call id",
  analysisResultUrl: 'URL for call analysis fetching',
}

Last updated