RoomKit
  • iOS : Objective-C
  • Android
  • Web
  • Flutter
  • Introduction
  • Demo app
  • Sample codes
  • Client SDKs
    • SDK downloads
    • Release notes
  • Getting started
    • Integration
    • Start a room
  • Guides
    • Customize room parameters
    • Customize the room UI
    • Listen for room callbacks
    • Screen rotation support
    • Screen sharing
    • Manage rooms with Education Cloud Service
    • Use server event callbacks
  • Server APIs
  • Error codes
  • Documentation
  • RoomKit
  • Server APIs
  • RoomKit Server APIs
  • Project statistics
  • List project's rooms in specified time period

List project's rooms in specified time period

Last updated:2022-02-25 17:04

1 Description

Lists all rooms created under a project where the room's scheduled start time falls within a certain time period.

2 Request method and endpoint

  • Request method: POST

  • Request endpoint:

    Service environment Rate limit Endpoint
    Production 1 request/second https://roomkit-api.zego.im/statistic/v2/room/get_project_rooms
  • Transmission protocol: HTTPS

3 Request parameters

Parameter Type Required Example Description
secret_id Int64 Yes 12580 The Secret ID assigned to your project by ZEGO.
access_token String Yes "CIE7hNPK6Y55DeUJBSDrInP" The server access token obtained via the get_access_token request.
pid Int64 Yes 1200 The Product ID assigned to your project by ZEGO.
begin_timestamp Int64 Yes 1616489840 Query start time, in seconds.
end_timestamp Int64 No 1616490214 Query end time, in seconds.
Default value: the current time.
page_no Uint32 No 1 The page number indicating which page of the query result is to be returned.
Default value: 1.
page_size Uint32 No 100 Number of entries per page.
Default value: 100.
Maximum value: 100.
  • The query time period cannot exceed 72 hours.
  • This request returns the project's room records where the room's scheduled start time falls within the given query time period [begin_timestamp, end_timestamp). The query results are sorted and paged in reverse order of the first login time.

4 Sample request

{
    "secret_id": 12580,
    "access_token": "access_token",
    "pid": 1200,
    "begin_timestamp": 1616489840,
    "end_timestamp": 1616490214,
    "page_no": 0,
    "page_size": 10
}

5 Response parameters

Parameter Type Example Description
ret Object - The returned status of the request.
ret.code Int 0 The returned code.
ret.message String "succeed" The returned message.
data Object - The returned data of the request.
data.count Int64 6 The total number of records in the query time period.
data.records Array of Object [] Array of the project's room records.
data.records[0].room_id String "123" Room ID.
data.records[0].token String "123456789" Room token.
data.records[0].room_name String "Music Class" Room name.
data.records[0].host_id Int64 12 The room host's User ID.
data.records[0].host_name String "Rachel" The room host's User Name.
data.records[0].status Int64 1 Room status. See the room status definitions in the Room Status table below.
data.records[0].pre_begin_time Int64 1616489835 Scheduled start time of the room, in seconds. For rooms not managed by ZEGO's room management service, this parameter represents the room creation time.
data.records[0].pre_end_time Int64 1616489835 Scheduled end time of the room, in seconds. For rooms not managed by ZEGO's room management service, this parameter is not included in the returned data.
data.records[0].start_time Int64 1616489835 Actual start time of the room, in seconds. Returns 0 if not yet started.
data.records[0].close_time Int64 1616489835 Actual end time of the room, in seconds. Returns 0 if not yet ended.

Room status:

Status value Status description
1 Not yet started
2 In progress
4 Ended
8 Cancelled

6 Sample response

{
    "ret": {
        "code": 0,
        "message": "succeed"
    },
    "data": {
        "count": 1,
        "records": [
           {
                "room_id": "1234",
                "token": "123456789",
                "status": 4,
                "room_name": "Music Class",
                "pre_begin_time": 1616500094,
                "host_id": 100062204,
                "host_name": "Rachel",
                "start_time": 1616500092,
                "close_time": 1616500109
            }
        ]
    }
}
Page Directory