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
  • User statistics
  • Get user's room attendance records in specified time period

Get user's room attendance records in specified time period

Last updated:2022-02-25 17:04

1 Description

Gets a user's room attendance records in 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/user/get_attendance_records
  • 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.
uid Int64 Yes 123 User ID.
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.
This request returns the user's room attendance records where the user's first login 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,
    "uid": 123,
    "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.uid Int64 123 User ID.
data.count Int64 6 The total number of records in the query time period.
data.records Array of Object [] Array of the user's room attendance records.
data.records[0].room_id String "123" Room ID.
data.records[0].room_name String "Music Class" Room name.
data.records[0].role Int64 1 User's role in the room. See the user role definitions in the User Role table below.
data.records[0].first_login_time Int64 1616489840 Time user first logged in to the room, in seconds.
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.

User roles:

Role value Role description
1 Host
2 Attendee
4 Assistant
8 Company Administrator

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": {
        "uid": 123,
        "count": 1,
        "records": [
            {
                "room_id": "123",
                "role": 2,
                "first_login_time": 1616490238,
                "room_name": "Music Class",
                "host_id": 123,
                "host_name": "Rachel",
                "status": 4,
                "pre_begin_time": 1616489835,
                "start_time": 1616489840,
                "close_time": 1616490341
            }
        ]
    }
}
Page Directory