Query Room Participants and Resources
Query RTC room information, including:
- RTC room ID, session ID (
sessionId
), and creation time. - List of RTC room participants.
- Audio/video stream resources published by participants.
- Live streaming audience count and user IDs.
Request Method
POST: https://data center domain/rtc/room/query.json
Signature Rules: All requests to RC server APIs require signature verification. See API Request Signature for details.
Request Body Parameters
The HTTP request body contains a JSON object with the following structure:
Parameter | Type | Required | Description |
---|---|---|---|
roomId | String | Yes | The RTC room ID to query |
Request Example
POST /rtc/room/query.json HTTP/1.1
Host: api.rong-api.com
App-Key: uwd1c0sxdlx2
Timestamp: 1585127132438
Nonce: 14314
Signature: 45beb7cc7307889a8e711219a47b7cf6a5b000e8
Room-Id: room1
Content-Type: application/json
{
"roomId":"room1"
}
Response
The HTTP response body contains a JSON object with the following structure:
Field | Type | Description |
---|---|---|
code | Number | Business status code. 200 indicates success. See Status Codes for details. |
roomId | String | Current RTC room ID |
sessionId | String | Current RTC session ID. The session ID can also be obtained through RC server callbacks. See Room Status Callback. |
createTime | Number | Room creation timestamp in milliseconds since January 1, 1970 00:00:00 UTC |
members | Array | Participant and resource information. Note: For live streaming rooms, the members object only contains host information. |
members[i].userId | String | User ID |
members[i].joinTime | Number | Participant join timestamp in milliseconds since January 1, 1970 00:00:00 UTC |
members[i].data | Object | Published resource information |
members[i].data.uris | Array | List of resource URIs (see details below) |
members[i].data.uris[i].mediaType | Number | Resource type. 0 : Audio; 1 : Video. |
members[i].data.uris[i].msid | String | Stream ID |
members[i].data.uris[i].uri | String | Globally unique resource URI (format irrelevant) |
members[i].data.uris[i].tag | String | Client-specified stream tag. Default tag is RongCloudRTC . |
members[i].data.uris[i].state | Number | Resource state. 0 : Disabled; 1 : Enabled. |
total | Number | Total audience count in live streaming rooms (only valid for live mode) |
views | Array | List of audience user IDs in live streaming rooms (only valid for live mode) |
Response Example
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"code":200,
"roomId":"444",
"sessionId":"cRZTAOjBsS8gUZLrTTIO_A",
"createTime":1585043771361,
"members":[
{
"userId":"13811223344_h0fc_web",
"joinTime":1585043771362,
"data":{
"uris":[
{
"mediaType":0,
"msid":"13811223344_h0fc_web_RongCloudRTC",
"uri":"{\"clusterId\":\"rtc-data-dev-rtc40-15-bdcbj.rongcloud.net\",\"serverId\":\"172.24.151.15:9005\",\"resourceId\":\"13811223344_h0fc_web_RongCloudRTC_0\",\"connectionId\":\"AAY2NjM0NjMAFDEzODExMjIzMzQ0X2gwZmNfd2ViAAM0NDQA\",\"ssrc\":2750434140,\"serviceProvider\":\"awsnx\",\"userTimestamp\":1585043802893}",
"tag":"RongCloudRTC",
"state":1
},
{
"mediaType":1,
"msid":"13811223344_h0fc_web_RongCloudRTC",
"uri":"{\"clusterId\":\"rtc-data-dev-rtc40-15-bdcbj.rongcloud.net\",\"serverId\":\"172.24.151.15:9005\",\"resourceId\":\"13811223344_h0fc_web_RongCloudRTC_1\",\"connectionId\":\"AAY2NjM0NjMAFDEzODExMjIzMzQ0X2gwZmNfd2ViAAM0NDQA\",\"ssrc\":1782111418,\"serviceProvider\":\"awsnx\",\"userTimestamp\":1585043802893}",
"tag":"RongCloudRTC",
"state":1
}
]
}
}
]
}