Webhooks
What are Webhooks?
Webhooks are powerful tools that allow real-time communication between LiveSwitch and your external systems. They act as customizable event listeners, automatically sending notifications to your specified web server whenever key actions occur within LiveSwitch. This enables you to seamlessly integrate LiveSwitch events into your own applications and workflows.
Here's how it works:
- You define a webhook by specifying a URL for your server endpoint.
- LiveSwitch monitors for specific events you're interested in.
- When an event occurs, LiveSwitch sends an HTTP POST request to your URL.
- The request body contains detailed event information in JSON format.
- Your server can then process this data and respond accordingly.
With webhooks, you can build responsive, event-driven applications that leverage LiveSwitch's capabilities while seamlessly integrating with your existing infrastructure.
Webhooks are most commonly used to notify customers when a session's recording is ready for download. After a session ends, the system processes the recording by mixing audio and video from all participants into a single file. Once the mixed recording is ready, the system sends a notification via the registered webhook, allowing customers to download the complete recording without manually checking for updates.
Setting Up a New Webhook
To add a new webhook, in the console for the given application, click NEW and configure the following settings:
- Name: Name of the webhook; it doesn't have to be unique.
- URL: The server to which event information will be sent via a POST request. Both HTTP and HTTPS are supported, but HTTPS is recommended.
- Event Category: Choose which level the webhook applies to:
- Connection (application-level)
- Client (client-level)
- Channel (channel-level)
- Event Lifecycle: The events available for the given category. When triggered, events send a POST request to your configured webhook.
- Batch: Turn on the control to send multiple events in a single POST request. Otherwise, each event results in a separate POST request.
- Disabled: Turn on the control to disable all events.