Large Classes
  • Overview
  • Demo App
  • Sample Codes
  • SDK Integration
  • Teacher-Side Implementation
  • Student-Side Implementation
  • GoClass Backend Service
  • Error Codes
  • Documentation
  • Large Classes
  • GoClass Backend Service
  • Log in to a Classroom

Log in to a Classroom

Last updated:2022-03-22 13:06

1 Description

Call login_room to log in to a classroom and get the classroom settings, such as the default microphone/camera status, microphone/camera permissions, and maximum number of co-hosting members allowed, etc.

API call frequency limit: 10 times/second.

2 API Prototype

  • Request method: POST
  • Request endpoint: /edu_room/login_room
  • Transmission protocol: application/json

3 Request Parameters

Parameter Type Mandatory Example Description
room_id String Yes "123456" Room ID of the classroom, a string with a maximum of 9 characters and contains only digits.
uid Int64 Yes 171171717 User ID.
nick_name String Yes "Shawn" User nickname, up to 15 characters.
role Int32 Yes 1 User role.

Valid values:
  • 1: Teacher
  • 2: Student
room_type Int32 No 2 Room type.

Valid values:
  • 1: Small class
  • 2: Large class
Defaults to "Small class" if not specified.

4 Request Example

{
  "uid":171171717,
  "room_id":"123456",
  "nick_name":"Shawn",
  "role":2,
  "room_type":2
}

5 Response Parameters

Parameter Type Example Description
room_id String "123456" Room ID of the classroom.
max_join_live_num Int32 4 Maximum number of co-hosting members (participating in live interactions) allowed.
default_camera_state Int32 2 The default camera state. If the user's current camera status is inconsistent with this default setting, call set_user_info to change it.

Valid values:
  • 1: Off
  • 2: On
default_mic_state Int32 2 The default microphone state. If the user's current microphone status is inconsistent with this default setting, call set_user_info to change it.

Valid values:
  • 1: Off
  • 2: On
allow_turn_on_camera Int32 2 Whether students are allowed to turn on their camera by themselves.

Valid values:
  • 1: Not allow
  • 2: Allow
allow_turn_on_mic Int32 2 Whether students are allowed to turn on their microphone by themselves.

Valid values:
  • 1: Not allow
  • 2: Allow
uid Int64 171171717 User ID.
nick_name String "Shawn" User nickname.
role Int32 1 User role.

Valid values:
  • 1: Teacher
  • 2: Student
camera Int32 1 User's camera status.

Valid values:
  • 1: Off
  • 2: On
mic Int32 1 User's microphone status.

Valid values:
  • 1: Off
  • 2: On
can_share Int32 2 User sharing permission.

Valid values:
  • 1: Off
  • 2: On
login_time Int64 1600920322511 The time when the user logged in to the classroom, a Unix timestamp in milliseconds.

6 Response Example

{
  "ret": {
    "code": 0,
    "message": "succeed"
  },
  "data": {
    "max_join_live_num": 4,
    "room_id": "123456",
    "default_camera_state": 2,
    "default_mic_state": 2,
    "allow_turn_on_camera": 2,
    "allow_turn_on_mic": 2,
    "uid": 171171717,
    "nick_name": "Shawn",
    "role": 1,
    "login_time": 1600920322511,
    "camera": 1,
    "mic": 1,
    "can_share": 2
  }
}

7 Return Codes

Return Code Description
10001 There is already a teacher in the class, you cannot join as a teacher.
10002 Cannot join the class because it is full.
Page Directory