tencent cloud

Feedback

CreateRoom

Last updated: 2024-09-27 15:42:48

    1. API Description

    Domain name for API request: lcic.tencentcloudapi.com.

    This API is used to create a room.
    A maximum of 20 requests can be initiated per second for this API.

    A maximum of 20 requests can be initiated per second for this API.

    We recommend you to use API Explorer
    Try it
    API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

    2. Input Parameters

    The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

    Parameter Name Required Type Description
    Action Yes String Common Params. The value used for this API: CreateRoom.
    Version Yes String Common Params. The value used for this API: 2022-08-17.
    Region No String Common Params. This parameter is not required.
    Name Yes String Room name
    StartTime Yes Integer Reserved room start time, in UNIX timestamp format
    EndTime Yes Integer Reserved room end time, in UNIX timestamp format
    SdkAppId Yes Integer LCIC SdkAppId
    Resolution Yes Integer Resolution. Valid values: 1: SD; 2: HD; 3: FHD
    MaxMicNumber Yes Integer Maximum number of mic-on users (excluding teachers). Value range: [0, 16]. This value affects billing, please set it according to the actual business situation. For billing rules, see "Billing Overview" under "Purchase Guide". Example:
    1: Billing based on the 1v1 rule;
    10: Billing based on the 1v7-12 rule.
    SubType Yes String The room subtype. Valid values: videodoc: Document + Video; video: Video only.
    TeacherId No String The user ID of the teacher. User IDs are returned by the user registration APIs. The user specified will have teacher permissions in the room created.
    AutoMic No Integer Whether to automatically turn the mic on when the user enters a room. Valid values: 0: No (default value); 1: Yes.
    TurnOffMic No Integer Whether to disconnect communication after audio/video permissions are revoked. Valid values: 0 (default): Yes; 1: No.
    AudioQuality No Integer Whether to enable the high audio quality mode. Valid values: 0: No (default value); 1: Yes.
    DisableRecord No Integer Whether to disable auto recording. Valid values: 0: No (default); 1: Yes. If this parameter is 0, recording will start when the class starts and stops when the class ends.
    Assistants.N No Array of String The user IDs of the teaching assistants. User IDs are returned by the user registration APIs. The users specified will have teaching assistant permissions in the room created.
    RTCAudienceNumber No Integer The number of RTC users.
    AudienceType No Integer The audience type.
    RecordLayout No Integer Recording layout
    GroupId No String The ID of the group to bind. If you specify this parameter, only members of the group can enter this room.
    EnableDirectControl No Integer Whether the teacher/teaching assistant can control students' cameras/microphones without the students' consent. Valid values:
    0 (default): No (consent required)
    1: Yes (no consent required)
    InteractionMode No Integer Turn on focus mode. 0 Watch all character audio and video (default) 1 Watch only teachers and assistants
    VideoOrientation No Integer Horizontal and vertical screen. 0: Horizontal screen (default); 1: Vertical screen , currently only support mobile video type
    IsGradingRequiredPostClass No Integer Enable after-class grading. 0: not on (default) 1: on
    RoomType No Integer Room Type: 0 Small Classroom(default); 1 Lecture Hall(public class)
    EndDelayTime No Integer Drag class time: unit: minutes. 0: no limit (default), -1: can't drag class, greater than 0: the time of dragging class. maximum value: 120 minutes.
    LiveType No Integer Live type: 0 regular (default) 1 Simulated Live
    RecordLiveUrl No String Simulated Live link
    EnableAutoStart No Integer Whether to start the lesson automatically: 0 not automatic lesson (default) 1 automatic lesson live_type=1 is valid when
    RecordBackground No String Recorded file background image, support png, jpg, jpeg, bmp format, does not support transparent channel for the time being
    RecordScene No String Record customized scene, only recordlayout=9 this parameter is valid, the data content for the user-defined scene parameters, data format for the json key-value pairs, where the key-value pairs of the value for the string type.
    RecordStream No Integer Recording type. 0: Records only mixed streams (default); 1: Records mixed streams and single streams. In this mode, in addition to the mixed streams, the audio and video streams of the teacher and students on stage are recorded separately. Each recording incurs corresponding recording fees. Example: 0.

    3. Output Parameters

    Parameter Name Type Description
    RoomId Integer Room ID
    RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

    4. Example

    Example1 Creating a room

    This example shows you how to create a classroom.

    Input Example

    POST / HTTP/1.1
    Host: lcic.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: CreateRoom
    <Common request parameters>
    
    {
        "Name": "abc",
        "StartTime": 1,
        "EndTime": 1,
        "TeacherId": "abc",
        "SdkAppId": 1,
        "Resolution": 1,
        "MaxMicNumber": 1,
        "AutoMic": 1,
        "TurnOffMic": 1,
        "AudioQuality": 1,
        "SubType": "abc",
        "DisableRecord": 1,
        "Assistants": [
            "abc"
        ],
        "RTCAudienceNumber": 1,
        "AudienceType": 1,
        "RecordLayout": 1,
        "GroupId": "abc",
        "EnableDirectControl": 0
    }
    

    Output Example

    {
        "Response": {
            "RoomId": 1,
            "RequestId": "abc"
        }
    }
    

    5. Developer Resources

    SDK

    TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

    Command Line Interface

    6. Error Code

    The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

    Error Code Description
    FailedOperation Operation failed.
    FailedOperation.ClassTooLong A class session cannot be longer than five hours.
    FailedOperation.RequestTimedOut Request timed out.
    InternalError Internal error.
    InvalidParameter Invalid parameter.
    InvalidParameter.Content Prohibited content (pornographic, terrorist, politically sensitive) detected.
    InvalidParameter.EndTime The end time cannot be earlier than the current time.
    InvalidParameter.RoomTypeInvalid
    InvalidParameter.SdkAppId SdkAppId is incorrect.
    InvalidParameter.StartTime The start time cannot be earlier than the current time.
    ResourceInsufficient Insufficient resource.
    ResourceInsufficient.Record Insufficient storage space.
    ResourceInsufficient.Room Failed to enter the class. Please check your resource usage in the console.
    ResourceNotFound.GroupNotExist The group does not exist.
    ResourceNotFound.User The user does not exist.