GoChat
  • Overview
  • Demo App
  • SDK Integration
  • Client-Side Implementation
  • GoChat Cloud Service
  • Server APIs
  • Error codes
  • Documentation
  • GoChat
  • Server APIs
  • List Rooms

List Rooms

Last updated:2022-03-22 13:06

1 Description

Gets the list of all chat rooms from the GoChat backend service.

Rate limit: 10 requests / second.

2 Request Method and Endpoint

  • Request method: POST
  • Request endpoint: /chat_room/get_room_list
  • Content-Type: application/json

3 Request Parameters

Parameter Type Required Example Description
uid Int32 Yes 171171717 User ID.
count Int32 Yes 10 Number of entries per page.
begin_timestamp Int64 No 0 Start time, a Unix timestamp in milliseconds. When 0 is specified, it returns x number of recently created rooms, where x is the value of the parameter count.

4 Request Example

{
  "uid":171171717,
  "room_id":"123456",
  "room_type": 2
}

5 Response Parameters

Parameter Type Example Description
room_list Object - Room list.

The data structure of room_list is as follows:

Parameter Type Example Description
room_list.room_id String "200113279" Room ID.
room_list.subject String "I love this game" Room subject.
room_list.create_time Int64 1608186550647 Room creation time, in milliseconds.
room_list.creator_name Int32 "Shawn" Name of the room creator.
room_list.creator_id String "1608186550647" User ID of the room creator.
room_list.online_count Int32 2 Number of members currently in the room.
room_list.on_stage_count Int32 2 Number of room members participating in the chat.

6 Response Example

{
    "ret": {
        "code": 0,
        "message": "succeed"
    },
    "data": {
        "room_list": [
            {
                "room_id": "200113279",
                "subject": "I love this game",
                "create_time": 1608186550647,
                "creator_name": "shawn",
                "creator_id": 1608186550647,
                "online_count": 1,
                "on_stage_count": 1
            }
        ]
    }
}

7 Return codes

Return code Description
80012 The user is offline.
Page Directory