Join Room Token API
The Huddle01 API provides the ability to create rooms for hosting various communication experiences. 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/v1/join-room-token
The Join Room Token API is used for the creation of tokens that can be used to join a room from an iframe. These tokens are valid for a period of 30 minutes, making them the perfect way to ensure secure and controlled access to your meeting or event. By using the Join Room Token API, users can join a room as either a host or a guest, depending on their requirements.
This flexibility ensures that all participants have the access they need to make the most of the meeting or event. One of the key benefits of the Join Room Token API is that it can autopopulate metadata such as displayName and avatarUrl. This makes it easier for participants to join the meeting or event with the correct details, without having to manually enter them each time.
/join-room-token
Join Room Token API
The API supports a POST request with the following required parameters:
roomId
- The RoomId of the room, for which you need to get the details.userType
- The type of user joining the room. Can be eitherhost
orguest
.
const response = await axios.post(
'https://api.huddle01.com/api/v1/join-room-token',
{
roomId: "jkb-yqis-bqg",
userType: "host"
},
{
headers: {
'Content-Type': 'application/json',
'x-api-key': {{API_KEY}},
},
}
);
Upon success, the API will return a response with the following fields:
token
- The Token which can be used to join the room.hostUrl
- The host url of the room created.redirectUrl
- The redirect url of the room created, should be embeded in an iframe.
In case of an error, the API will return an error message with a corresponding status code.
{
token: 'eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb29tSWQiOiJqa2IteXFpcy1icWciLCJ1c2VyVHlwZSI6Imd1ZXN0IiwiZ3Vlc3RBc0hvc3QiOmZhbHNlLCJob3N0TmFtZSI6Imh0dHA6Ly9sb2NhbGhvc3Q6MzAwMCIsImlhdCI6MTY4MTM4NTAzMCwiZXhwIjoxNjgxNjQ0MjMwfQ',
hostUrl: 'http://localhost:3000',
redirectUrl: 'http://localhost:3000/jkb-yqis-bqg/token?token=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb29tSWQiOiJqa2IteXFpcy1icWciLCJ1c2VyVHlwZSI6Imd1ZXN0IiwiZ3Vlc3RBc0hvc3QiOmZhbHNlLCJob3N0TmFtZSI6Imh0dHA6Ly9sb2NhbGhvc3Q6MzAwMCIsImlhdCI6MTY4MTM4NTAzMCwiZXhwIjoxNjgxNjQ0MjMwfQ',
}
Request
Params | Definition | Data Type | Mandatory |
---|---|---|---|
roomId | The RoomId of the room, for which you need to get the details. | string | Y |
displayName | The display name of the user, who is joining the room. | string | Y |
userType | The type of the user, who is joining the room. The possible values are host and guest. | 'host' | 'guest' | Y |
guestAsHost | The anyone who first joins the room will be the host. | boolean | N |
Response
Fields | Definition | Data Type | Mandatory |
---|---|---|---|
token | The token, which is used to join the room. This token is valid for 30 mins. | string | Y |
hostUrl | The host url of the room. | string | N |
redirectUrl | The redirect url of the room. | string | N |