Configuring Webhooks for Data Sync
Overview
ScreenMeet webhooks send session events to a URL you control as they happen. Use webhooks to sync session data into a CRM or ticketing system, trigger automation when a session starts or ends, or keep an external record of session activity.
ScreenMeet sends each event as a signed HTTP POST request. Your application verifies the signature with your organization's signing key to confirm the request came from ScreenMeet.
Prerequisites
- A ScreenMeet console account with the Administrator role.
- A publicly reachable endpoint that accepts HTTPS POST requests. The URL must start with
https://. - The ability to read the raw request body on your endpoint before it is parsed.
Step 1: Copy Your Signing Key
- Sign in to the ScreenMeet console as an Administrator.
- Open the menu and go to Organization > Integration Signing Key.
- Click Show, then click Copy.
- Store the key as a secret in your application's environment.
Step 2: Create the Webhook
- In the ScreenMeet console, go to Organization > Webhooks.
- Click New Webhook.
- In Webhook URL, enter your endpoint URL.
- Optional: click Test next to the URL to send a test request to your endpoint.
- In Description, enter a name that identifies the destination system.
- Turn on Is Active. Inactive webhooks do not send events.
- Click Save Changes.
The webhook now appears in the Organization Webhooks list with its status. Changes can take up to 10 minutes to take effect.
Step 3: Handle Incoming Requests
ScreenMeet sends each webhook request in the following format.
| Element | Value |
|---|---|
| Method | POST |
| URL | The Webhook URL you configured. |
Content-Type header | text/plain |
x-signature header | The request signature. |
x-signature-algo header | The signing algorithm. Currently sha256. |
| Body | A JSON array of one or more event objects. |
The body is always a JSON array, even when it contains a single event. Iterate over the array and process each event by its type. For field definitions and event types, see the Webhook Data Dictionary.
text/plain on purpose. Many web frameworks decode JSON bodies automatically, which changes the bytes and breaks signature verification. Read the raw body as text, verify it, then parse it as JSON.ScreenMeet can deliver several events in one request, including events that occurred earlier in the session. Use each event's ts field to order events.
Step 4: Verify the Signature
- Read the raw request body exactly as received, before any JSON parsing.
- Compute a signature over the raw body using your signing key and the algorithm named in
x-signature-algo. - Compare your computed value to the
x-signatureheader. - If the values do not match, reject the request and do not process the events.
Detecting When a Session Starts and Ends
To keep an external process in step with a ScreenMeet session, such as holding a chat open while screen sharing is in progress, act on these two events and ignore the rest.
session-activated: a participant joined and the session status is nowactive.session-closed: the session ended.stats.termination-reasonandstats.time-endeddescribe how and when.
Match events to your records using the session id. This is the value after the ? in a Live session link, for example AbCdEfGhIjKl in https://live.screenmeet.com/?AbCdEfGhIjKl.
active and session-closed is not sent. Have agents end the session in ScreenMeet when they finish.GET /v3/discovery?ids= accepts a comma-separated list of session IDs and returns only the sessions that are currently active. See ScreenMeet API: Poll Session State.Verification
- On the webhook form, click Test and confirm your endpoint receives the request.
- Create a test session in the ScreenMeet console. Confirm your endpoint receives a
session-createdevent for that session ID. - Join the session from another browser. Confirm a
session-activatedevent arrives. - End the session. Confirm a
session-closedevent arrives withstatusset toclosed. - Confirm your signature check passes on each request.