List Peers
You can use this API for get the active peers in the room. Peers can be filtered by specifying user_id
or role
in the query params.
If no peers match the filtering criteria response will have an empty peers list.
GEThttps://api.100ms.live/v2/active-rooms/<room_id>/peers
curl --location --request GET 'https://api.100ms.live/v2/active-rooms/<room_id>/peers' \ --header 'Authorization: Bearer <management_token>'
RESPONSE
Status: 200 OK
{ "peers": { "dcd88eb0-83e6-486a-bcae-c3be5e0f2c20": { "id": "dcd88eb0-83e6-486a-bcae-c3be5e0f2c20", "name": "John", "user_id": "student-3461", "metadata": "", "role": "student", "joined_at": "2023-01-25T12:06:34.080990401Z" }, "4e03dce3-ddec-4bdd-b91b-0b18be1a7f10": { "id": "4e03dce3-ddec-4bdd-b91b-0b18be1a7f10", "name": "Nick", "user_id": "teacher-81", "metadata": "", "role": "teacher", "joined_at": "2023-01-25T12:04:30.366388779Z" } } }
Allowed filters
Name | Type | Description | Required |
---|---|---|---|
user_id | string | Determines the peers with specified user_id (your internal user identifier used while creating the auth token for peers) | No |
role | string | Determines the peers with specified role | No |
Why would you use this API?
- Use this API to identify the peers with given
user_id
orrole
. Further you can use retrieved peer information to perform actions such as updating peers, sending messages, and removing peers
Have a suggestion? Recommend changes ->