Documentation
Server_APIs_v2 Server APIs v2
Documentation
Demo APP
SDK Center
API Center
FAQ
Code Market
Console
Sign Up
Log In
中文站 English
  • Documentation
  • Server APIs v2
  • Room signaling
  • Get the number of in-room users

Get the number of in-room users

Last updated:2024-08-08 18:42

1 Description

Gets the current number of users in a room.

2 Request method and endpoint

  • Request method: GET
  • Request endpoint: https://rtc-api.zego.im/?Action=DescribeUserNum
  • Transmission protocol: HTTPS
  • Rate limit (Rooms with the same AppID): 10 requests/second (Testing environment: 1 requests/second)

3 Request parameters

Listed below are the parameters specific to this request and part of the public request parameters. For the complete list of public request parameters, see Server APIs public request parameters.

Parameter Type Required Description
RoomId[]
Array of String
Yes
Room ID list, a maximum of 10 rooms are supported in one call. When a room does not exist, the number of people is 0.
Example: RoomId[]=room1&RoomId[]=room2

4 Request example

https://rtc-api.zego.im/?Action=DescribeUserNum
&RoomId[]=room1&RoomId[]=room2

&<Public Request Parameters>

5 Response parameters

Parameter Type Description
Code
Int32
Return code.
Message
String
Description of the request execution result.
RequestId
String
Request ID.
Data
Array of Object
Returned data.
└ RoomId
String
Room ID.
└ UserCount
Number
Number of users in the room.
AdminUserCount
Int32
Number of room administrators. This parameter is mainly used in scenarios such as cloud recording and audio/video stream auditing. If the room does not have such users, please ignore this parameter.

Please note that UserCount includes the number of AdminUserCount.

6 Response example

{
    "Code": 0,
    "Message": "success",
    "RequestId": "7840039829955402142",
    "Data": {
        "UserCountList": [
            {
                "RoomId": "room1",
                "UserCount": 2,
                "AdminUserCount": 0
            },
            {
                "RoomId": "room2",
                "UserCount": 3,
                "AdminUserCount": 1
            }
        ]
    }
}

7 Return codes

Please refer to Return codes.

Page Directory
  • Free trial
  • 提交工单
    咨询集成、功能及报价等问题
    电话咨询
    400 1006 604
    Get Consulting
    Scan Wechat QR code