Webhook
Introduction
Webhook is an HTTP(S) endpoint used for pushing the notifications to your application. It will be invoked by 100ms servers to notify events of your room.
Requirements
Webhook MUST implement POST
HTTP method for receiving notifications. 100ms notifications are in JSON format so it should be handled accordingly.
Additionally, you can specify headers which will be passed transparently to your webhook endpoint. This can be used for securing or tracing the origin of the request.
How to configure Webhook
Webhook can be configured using Developer section of 100ms Dashboard
Events
Event is a JSON dictionary which has following keys.
Event Attributes
Name | Type | Description | Example |
---|---|---|---|
version | string | Version of the event | 2.0 |
id | string | Id of the event | bd0c76fd-1ab1-4d7d-ab8d-bbfa74b620c4 |
app_id | string | App ID from which this event is generated | 5ff5881b80b66969e1fb35f6 |
account_id | string | App ID(Customer ID) from which this event is generated | 5ff5881b80b66969e1fb35f4 |
timestamp | timestamp | Timestamp of the event | 2020-11-11T16:32:17Z |
type | string | Type of the event | peer.join.success |
data | dict | Event data. Its keys will be different for different type of event. See the description below |
Sample Event Payload
{ "version":"2.0", "id":"6c75de35-b778-4fb0-88ae-114c28dc285f", "account_id":"60b8e13a6eb86d8101b57354", "timestamp":"2021-08-08T07:04:15Z", "type":"peer.join.success", "data":{ "joined_at":"2021-08-08T07:04:15.001380432Z", "peer_id":"83b869e1-9a4b-4037-84b2-913cf76e4392", "room_id":"60b8e13a6eb86d8101b57354", "session_id":"610f81ee870dde099a249948", "user_id":"test-user" } }
peer.join.success
This event will be send when any peer joins the room successfully
Attributes
Name | Type | Description | Example |
---|---|---|---|
room_id | string | 100ms assigned room id | 5f9edc6ac238215aec2312df |
peer_id | string | 100ms assigned id to identify the joining user | bd0c76fd-1ab1-4d7d-ab8d-bbfa74b620c4 |
joined_at | timestamp | Timestamp when user joined | 2020-11-11T16:32:17Z |
room_name | string | Room name assigned by you when creating room | class-9-batch-2 |
user_id | string | User id assigned by the customer | user.001 |
session_id | string | 100ms assigned id to identofy the session. A room can have multiple sessions | 5f9edc6bd238215aec7700df |
peer.leave.success
This event will be send when peer leaves the room
Attributes
Name | Type | Description | Example |
---|---|---|---|
room_id | string | 100ms assigned room id | 5f9edc6ac238215aec2312df |
peer_id | string | 100ms assigned id to identify the joining user | bd0c76fd-1ab1-4d7d-ab8d-bbfa74b620c4 |
left_at | string | Timestamp when user left | 2020-11-11T17:32:17Z |
room_name | string | Room name assigned by you when creating room | class-9-batch-2 |
user_id | string | User id assigned by customer | user.001 |
duration | number | Duration the user spent in the room in seconds | 36000 |
session_id | string | 100ms assigned id to identofy the session. A room can have multiple sessions | 5f9edc6bd238215aec7700df |
recording.success
This event will be send when final composed recording is generated and uploaded to the destination
Attributes
Name | Type | Description | Example |
---|---|---|---|
room_id | string | 100ms assigned room id | 5f9edc6ac238215aec2312df |
room_name | string | Room name assigned by you when creating room | class-9-batch-2 |
location | string | s3 URI of the recorded video | s3://bucket/prefix/ac.mp4 |
URL | string | Presigned s3 URL for the recorded video, for download. Valid for 24 hours | https://s3-location/bucket/ac.mp4 |
duration | number | Duration the user spent in the room in seconds | 3600 |
size | number | Size of the recorded video (in bytes) | 10024 |
session | string | 100ms assigned id identifying the session for the recording. A room can have multiple sessions | 5f9edc6bd238215aec7700df |