Session
Introduction
Session is a single continuous call in a room. To allow users to join a 100ms video conferencing session inside your app, you first need to create a room. A single room can have multiple sessions. You will need a management token as a bearer token for your requests.
Get Session Data using API
You can query session data using API.
GETGet Session API
https://api.100ms.live/v2/sessionsThis endpoint is used to get sessions.
curl --location --request GET 'https://api.100ms.live/v2/sessions?room_id=61652b404e556e35f2179759' -H 'Authorization: Bearer {{management_token}}'
Headers
| Name | Value | Required |
|---|---|---|
| Authorization | Bearer <management token> | Yes |
URL Parameters
| Name | Type | Description | Required |
|---|---|---|---|
| id | string | ID of the session if known. | No |
| room_id | string | Room ID of the session if known. | No |
| active | bool | Session is currently going on or not. | No |
| before | time | Timestamp before(inclusive) which session is created in RFC3339 format e.g. 2022-02-09T05:53:23.375Z. | No |
| after | time | Timestamp after(inclusive) which session is created in RFC3339 format e.g. 2022-02-09T05:53:23.375Z. | No |
| limit | int | Number of sessions returned by response. Range 10-20 | No |
| start | string | ID of the session after which to start the response. Sessions are returned in decreasing IDs or created_at timestamp. | No |
Response
| Name | Type | Description | Required |
|---|---|---|---|
| limit | int | Number of sessions the API tried to find. If returned array has lesser number of results, only those number were found. | No |
| data | array | Array of sessions or null if no session was found. | No |
| last | ObjectID | Sessions are returned in decreasing IDs or created_at timestamp. Last represent the earliest session returned by the response. | No |
How to calculate session duration
You can calculate additional information from session data using given information. Redundant information like peer duration/ session duration is not provided since they can be calculated from provided response. You can calculate peer duration by subtracting joined_at timestamp from left_at for a given peer. Similarly you can calculate session duration by adding all peers' duration.