GoChat
  • Overview
  • Demo App
  • SDK Integration
  • Client-Side Implementation
  • GoChat Cloud Service
  • Server APIs
  • Error codes
  • Documentation
  • GoChat
  • Server APIs
  • Create a Room

Create a Room

Last updated:2022-03-22 13:06

1 Description

Creates a chat room.

Rate limit: 10 requests / second.

2 Request Method and Endpoint

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

3 Request Parameters

Parameter Type Required Example Description
uid Int32 Yes 171171717 User ID.
subject String Yes "I love this game" Room subject.

4 Request Example

{
  "uid":171171717,
  "subject":"I love this game"
}

5 Response Parameters

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

6 Response Example

{
    "ret": {
        "code": 0,
        "message": "succeed"
    },
    "data": {
        "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
80001 Incorrect parameter.
80012 The user is offline.
Page Directory