Live Sessions API
The Live Sessions API provides the ability to fetch live rooms in which people are currently present. In order to use the API, you will need to obtain an API key by connecting to your wallet.
Endpoint
https://api.huddle01.com/api/v2/sdk/live-sessions
Whatever sessions are created using Create Room API and are joined by users, will be listed in the Live Sessions API. The API will return the list of all the rooms which are currently live and the number of users present in each room.
/live-sessions
Get All Live Sessions API
The API supports a GET request with the following required parameters:
x-api-key
- Add your API Key to the headers to fetch all rooms associated with your API Key.
const response = await axios.get(
'https://api.huddle01.com/api/v2/sdk/live-sessions',
{},
{
headers: {
'Content-Type': 'application/json',
'x-api-key': {{API_KEY}},
},
}
);
Upon success, the API will return a response with an array of rooms with the following fields:
roomId
- The roomId of the room.startTime
- The start time of session in EpochliveStreamCount
- The count of live streams associated with this sessionrecordingCount
- The count of recordings associated with this session
In case of an error, the API will return an error message with a corresponding status code.
{
"liveSessions": [
{
"roomId": "mjc-vksd-ktu",
"startTime": 1724825547555,
"livestreamCount": 1,
"recordingCount": 1
},
{
"roomId": "gar-ouoz-szl",
"startTime": 1724180396850,
"livestreamCount": 0,
"recordingCount": 0
}
]
}
Endpoint
https://api.huddle01.com/api/v2/sdk/live-sessions/:roomId
If the room isn't live, the API will throw a 404 NOT FOUND error.
Whatever sessions are created using Create Room API and are joined by users, will be listed in the Live Sessions API. The API will return the list of all the rooms which are currently live and the number of users present in each room.
/live-sessions/:roomId
Get Single Live Sessions API
The API supports a GET request with the following required parameters:
x-api-key
- Add your API Key to the headers to fetch all rooms associated with your API Key.YOUR_ROOM_ID
- Add the roomId in path params to fetch the details of a single active room.
const response = await axios.get(
'https://api.huddle01.com/api/v2/sdk/live-sessions/YOUR_ROOM_ID',
{
headers: {
'Content-Type': 'application/json',
'x-api-key': {{API_KEY}},
},
}
);
Upon success, the API will return a response with the following fields:
roomId
- The roomId of the room.startTime
- The start time of session in epochliveStreamCount
- The count of live streams associated with this sessionrecordingCount
- The count of recordings associated with this sessioncurrentPeerCount
- The count of peers currently inside session
{
"liveSessions": [
{
"roomid": "gar-ouoz-szl",
"starttime": 1724825547555,
"currentPeerCount": 412,
"livestreamCount": 1,
"recordingCount": 1
}
]
}