Skip to main content
Version: /v2

Fetch Sessions

This API lets you fetch details of all your sessions of room by passing roomId or customRoomId as parameter. Optionally, if you don't specify a roomid or customRoomId, you will fetch all the sessions of all your rooms.
Query Parameters
REQUIRED

The ID of the Room.

OPTIONAL

Customize Room id which you had specified in Create Room API.

OPTIONAL

defaultValue : 1

Page number for the sessions.

OPTIONAL

defaultValue : 20

Number of sessions you want per page.

GET
|
https://api.videosdk.live/v2/sessions/
import fetch from 'node-fetch';
const options = {
method: "GET",
headers: {
"Authorization": "$YOUR_TOKEN",
"Content-Type": "application/json",
},
};
const url= `https://api.videosdk.live/v2/sessions/?roomId=xyz&customRoomId=xyz&page=1&perPage=20`;
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
RESPONSE
{
"pageInfo": {
"currentPage": 1,
"perPage": 2,
"lastPage": 5,
"total": 10
},
"data": [
{
"id": "621497578bea0d0404c35c4c",
"roomId": "abc-xyzw-lmno",
"start": "2022-02-22T07:57:11.505Z",
"end": "2022-02-22T07:58:11.505Z",
"participants": [
{
"participantId": "but3ihic",
"name": "Jacques",
"timelog": [
{
"start": "2022-02-22T07:57:13.420Z",
"end": "2022-02-22T07:59:13.420Z"
}
]
},
{
"participantId": "mcg1jq0s",
"name": "Rahul",
"timelog": [
{
"start": "2022-02-22T07:57:50.210Z",
"end": "2022-02-22T07:59:13.420Z"
}
]
}
],
"status": "ended",
"links": {
"get_room": "https://api.videosdk.live/v2/rooms/abc-xyzw-lmno",
"get_session": "https://api.videosdk.live/v2/sessions/621497578bea0d0404c35c4c"
}
}
]
}