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

Webhook

Events

Event is a JSON dictionary which has following keys.

Event Attributes

NameTypeDescriptionExample
versionstringVersion of the event2.0
idstringId of the eventbd0c76fd-1ab1-4d7d-ab8d-bbfa74b620c4
app_idstringApp ID from which this event is generated5ff5881b80b66969e1fb35f6
account_idstringApp ID(Customer ID) from which this event is generated5ff5881b80b66969e1fb35f4
timestamptimestampTimestamp of the event2020-11-11T16:32:17Z
typestringType of the eventpeer.join.success
datadictEvent 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

NameTypeDescriptionExample
room_idstring100ms assigned room id5f9edc6ac238215aec2312df
peer_idstring100ms assigned id to identify the joining userbd0c76fd-1ab1-4d7d-ab8d-bbfa74b620c4
joined_attimestampTimestamp when user joined2020-11-11T16:32:17Z
room_namestringRoom name assigned by you when creating roomclass-9-batch-2
user_idstringUser id assigned by the customeruser.001
session_idstring100ms assigned id to identofy the session. A room can have multiple sessions5f9edc6bd238215aec7700df

peer.leave.success

This event will be send when peer leaves the room

Attributes

NameTypeDescriptionExample
room_idstring100ms assigned room id5f9edc6ac238215aec2312df
peer_idstring100ms assigned id to identify the joining userbd0c76fd-1ab1-4d7d-ab8d-bbfa74b620c4
left_atstringTimestamp when user left2020-11-11T17:32:17Z
room_namestringRoom name assigned by you when creating roomclass-9-batch-2
user_idstringUser id assigned by customeruser.001
durationnumberDuration the user spent in the room in seconds36000
session_idstring100ms assigned id to identofy the session. A room can have multiple sessions5f9edc6bd238215aec7700df

recording.success

This event will be send when final composed recording is generated and uploaded to the destination

Attributes

NameTypeDescriptionExample
room_idstring100ms assigned room id5f9edc6ac238215aec2312df
room_namestringRoom name assigned by you when creating roomclass-9-batch-2
locationstrings3 URI of the recorded videos3://bucket/prefix/ac.mp4
URLstringPresigned s3 URL for the recorded video, for download. Valid for 24 hourshttps://s3-location/bucket/ac.mp4
durationnumberDuration the user spent in the room in seconds3600
sizenumberSize of the recorded video (in bytes)10024
sessionstring100ms assigned id identifying the session for the recording. A room can have multiple sessions5f9edc6bd238215aec7700df