API Reference
VideoSDK provides REST APIs for RealTime Communication, which includes APIs for Rooms, Sessions, Recordings, RTMP and HLS.
https://api.videosdk.live
Authentication
The VideoSDK API uses access token to authenticate api requests.
In REST APIs, token will be passed in a header field called Authorization
.
In order to generate authentication token, you will need API_KEY
and SECRET
, which you can get them from here.
In payload, you have to add your apikey
, permissions
, version
and role
.
If you are concerned with security and want to generate token only for v2 API access, then you need to provide version
and role
.
-
apikey
(Mandatory): You can get it from here. -
permissions
(Mandatory): Based on provided permission, participant will join the meeting accordingly.Available permissions are:
allow_join
: The participant is allowed to join the meeting directly.ask_join
: The participant requires to ask for permission to join the meeting.allow_mod
: The participant is allowed to toggle webcam & mic of other participants.
-
version
(optional): For accessing the v2 API, you need to provide2
as the version value.- For passing
roomId
,participantId
orroles
parameters in payload, it is essential to set the version value to2
.
- For passing
-
roomId
(optional): To provide customised access control, you can make the token applicable to a particular room by including theroomId
in the payload. -
participantId
(optional): You can include theparticipantId
in the payload to limit the token's access to a particular participant. -
roles
(optional):crawler
: This role is only for accessing v2 API, you can not use this token for running theMeeting
/Room
.rtc
: This role is only allow for running theMeeting
/Room
, you can not use server-side APIs.
Then, you will sign this payload with your SECRET
and jwt options.
const jwt = require('jsonwebtoken');
const API_KEY = <YOUR API KEY>;
const SECRET = <YOUR SECRET>;
const options = {
expiresIn: '120m',
algorithm: 'HS256'
};
const payload = {
apikey: API_KEY,
permissions: [`allow_join`], // `ask_join` || `allow_mod`
version: 2, //OPTIONAL
roomId: `2kyv-gzay-64pg`, //OPTIONAL
participantId: `lxvdplwt`, //OPTIONAL
roles: ['crawler', 'rtc'], //OPTIONAL
};
const token = jwt.sign(payload, SECRET, options);
console.log(token);
Room
To communicate or interact with others in audio or video call, you need `Room` for that. You can `create`, `validate` and `fetch` Rooms using Room APIs.
Session
Session refers to a single instance of a meeting. If you take multiple meetings with same `roomId`, then multiple session is created for that partcular roomId. With this API endpoints you can access details of sessions and its participants.
Meeting Recordings
This Meeting Recording APIs will allow you to start / stop / fetch / delete meeting recordings.
ENDPOINT
Participant Recordings
This Participant Recording APIs will allow you to start / stop / fetch / delete participant recordings.
Participant Track Recordings
This Participant Track Recording APIs will allow you to start / stop / fetch / delete track recordings.
RTMP OUT
This RTMP OUT APIs will allow you to start / stop RTMP stream of meeting.
HLS Live Stream
This HLS Live Stream APIs will allow you to start / stop / fetch HLS stream of meeting.
Got a Question? Ask us on discord