Webhook Basics

Learn how to get started with Telzio webhooks

General

When configuring your webhook you have two choices of format: JSON or x-www-form-urlencoded.

The consuming API has 15 seconds to accept the event. If a success http status code has not been returned with these 15 seconds, the event will be discarded and the engine will proceed to the next one.

Only one event is dispatched at a time, and in sequence. There is no parallel dispatch against a single customer end point, and the engine will not try to resend a failed request.

If a consuming API consistently fails over a period of time, the engine will suspend delivery until the customer manually re-enables distribution of events.

Authentication

The Telzio webhook supports authenticating against the customer API using either a, by the customer specified, Bearer Token or Basic Authentication. In both cases the customer enters either the token or credentials for basic auth on the Telzio website.

In case of Bearer token authentication, the engine will issue all HTTP Requests with the following Header: Authorization: Bearer

In case of Basic Authentication it will be as follows: Authorization: Basic

We highly encourage consumers to support HTTPS and use either Basic or Bearer-token based authentication.

JSON Encoded Events

This is an example of a call created event being posted as JSON. This example assumes that the hook has been configured to be http://example.com/webhook

POST /webhook
Host: www.example.com
X-Telzio-Event-Type: call_created
Content-Type: application/json; charset=utf-8

{
  "EventType":"call_created",
  "call_id":"9309b4a2-d59f",
  "direction":"outbound",
  "from":"jonas1",
  "from_cnam":"Jonas 1",
  "to":"78791245",
  "rate":0.0,
  "date":"2016-03-01T08:31:55.0000000"
}

Form-Urlencoded Events

POST /webhook
Host: www.example.com
X-Telzio-Event-Type: call_created
Content-Type: application/x-www-form-urlencoded

EventType=call_created&call_id=5909179e-e6c2&direction=outbound&from=jonas1&from_cnam=Jonas1&to=78791245&rate=0.0&date=2016-03-01T09%3A41%3A12.0000000