Skip to main content
Version: /v2

Fetch Active Participants

This API lets you fetch a number of currently active participants in a room session by passing sessionId as a parameter.
Query Parameters
OPTIONAL

defaultValue : 1

Page number for the participants.

OPTIONAL

defaultValue : 20

Number of participants you want per page.

Parameters
REQUIRED

The ID of the Session.

GET
|
https://api.videosdk.live/v2/sessions/${sessionId}/participants/active
import fetch from 'node-fetch';
const options = {
method: "GET",
headers: {
"Authorization": "$YOUR_TOKEN",
"Content-Type": "application/json",
},
};
const sessionId = "your_sessionId";
const url= `https://api.videosdk.live/v2/sessions/${sessionId}/participants/active?page=1&perPage=20`;
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
RESPONSE
{
"data": {
"id": "61763c2597b0c743cf454204",
"roomId": "abc-xyzw-lmno",
"participants": [
{
"participantId": "ylgjhgeh",
"name": "Demo-3",
"timelog": [
{
"start": "2021-10-25T05:10:30.129Z",
"end": null
}
]
},
{
"participantId": "x9mwdb2l",
"name": "Demo-5",
"timelog": [
{
"start": "2021-10-25T05:10:41.865Z",
"end": null
}
]
}
],
"links": {
"get_all_participants": "https://api.videosdk.live/v2/sessions/61763c2597b0c743cf454204/participants",
"get_session": "https://api.videosdk.live/v2/sessions/"
}
}
}