Create an online double teacher class
Interface function: Support users to pass the main class ID and sub-class information (in batches), complete the creation of sub-classes and bind the main and sub-classes
Interface description:
- The main class is the get out of class or classroom of the standard course, refer to Create a class or Create a classroom
- Returns information on whether each sub-class is created successfully or not, including the course ID, sub-class ID, and sub-class name of the sub-class
- Sub-classes do not need to pass the main teacher and time, and inherit the main teacher and time of the main class
- Sub-classes inherit the cloud disk resources of the course to which they belong
- The maximum number of subCalssJson is 100, limiting a single main class to bind up to 100 sub-classes
- If the sub-class needs to set up a live playback of the recorded class, useCoMainRecord, recordState, recordType, liveState, and openState must be passed at the same time, otherwise a parameter error will be reported
URL
https://root_url/lms/onlineDoubleTeacher/addClass
HTTP Request Methods
Request parameters
key |
Required |
Type |
Description |
X-EEO-SIGN |
Yes |
string |
Signature generation rules see here |
X-EEO-UID |
Yes |
string |
Organization SID |
X-EEO-TS |
Yes |
string |
Timestamp |
Body parameters
key |
Required |
Type |
Description |
Rule description |
mainCourseId |
Yes |
integer |
The course ID to which the main course belongs |
|
mainClassId |
yes |
integer |
main course ID |
main course can be a class or classroom |
subCalssJson |
yes |
array |
sub-course data |
subCalssJson has a maximum of 100, limiting a single main course to a maximum of 100 sub-courses |
└ courseId |
yes |
integer |
course ID to which the sub-course belongs |
course ID of each sub-course |
└ className |
yes |
string |
sub-course name |
length does not exceed 50 |
└ assistantUids |
no |
array |
list of co-teacher UIDs |
example: [1000082,1000083], UID is integer, no co-teacher is assumed if not passed |
└ cameraHide |
no |
integer |
whether to hide the seating area, 0 = display the seating area, 1 = hide the seating area |
The default value is 0. If it is not passed, the default value is used. When cameraHide=1, isAutoOnstage will always be set to 0. |
└ isAutoOnstage |
No |
integer |
Whether students automatically go on stage when entering the classroom, 1=not automatically, 2=automatically |
The default value is 1, if it is not passed, the default value is used |
└ seatNum |
No |
integer |
The number of people on stage, the number of people on stage for the new dual-teacher system is different from the V1 version of the course creation API; |
7=1v6 on stage, that is, including the teacher's avatar. For example, if 1 is passed, it means 1v0, and only the teacher's avatar is displayed on the stage. The default value is 7 (1v6). If it is not passed, the default value is used. If the maximum number of people on stage in the institution is less than 1v6, it will default to the maximum number of people on stage in the institution. |
└ isHd |
No |
integer |
Whether it is high-definition, 0=non-high-definition, 1=high-definition, 2=full high-definition |
The default value is 0, if it is not passed, the default value is used. Currently, only 1v1 and 1v6 are supported. That is, use seatNum=2 or seatNum=7 |
└ isDc |
No |
integer |
Dual-camera mode, whether to turn on the secondary camera, 0=disabled, 3=enable full HD secondary camera |
Default is 0, use the default value if not passed; only supports 1v1 use, that is, seatNum=2 |
└ useCoMainRecord |
No |
integer |
Whether to use the main course recording and broadcasting, 1=enable, 0=disabled |
useCoMainRecord is 1, and the sub-course related values about recording and live broadcast will be ignored |
└ recordState |
No |
integer |
Whether to turn on recording, 0=disabled, 1=enabled |
Default is 0, use the default value if not passed. If webpage live broadcast or webpage playback is required, you must select recording, otherwise webpage live broadcast and webpage playback cannot be turned on |
└ recordType |
No |
integer |
Recording type, 0=record classroom, 1=record teacher, 2=record both |
Must be passed when setting recording |
└ liveState |
No |
integer |
Whether to enable live broadcast, 0=off, 1=on |
Default is 0, use the default value if not passed. If webpage live broadcast is required, recording must be enabled |
└ openState |
No |
integer |
Whether to enable public playback, 0=off, 1=on |
Default is 0, use the default value if not passed. If webpage playback is required, recording must be enabled |
└ uniqueIdentity |
No |
string |
The unique identifier of the lesson. If it exists, the creation fails and the historical lesson ID is returned |
32 characters, an error is reported if the limit is exceeded. The organization can pass the unique identifier. After passing this value, we will check whether this unique identifier already exists under the organization |
Response parameters
Parameter name |
Type |
Example value |
Meaning |
code |
integer |
1 |
Error code |
msg |
string |
"Program executes normally" |
Error message |
data |
object |
|
Return information object |
└ mainClassId |
integer |
4157055 |
Main course ID |
└ mainCourseId |
integer |
2337435 |
Main course ID |
└ subClassData |
array |
[{Sub-class data}] |
Sub-class data array |
Sub-class data
Example
POST /lms/onlineDoubleTeacher/addClass HTTP/1.1
root_url
43a81ec4d7b213d20912826d95ba381a
2669800 X-EEO-TS: 1732270810 Content-Type: application/json Content-Length: 539 { "mainCourseId": 2337435, "mainClassId": 4157055, "subClassJson": [ { "courseId": 2337436, "className": "2337436-subClassName", "seatNum": 7, "isHd": 2, "isDc": 0, "cameraHide": 0, "isAutoOnstage": 1, "liveState": 1, "openState": 1, "recordState": 1, "recordType": 0, "useCoMainRecord": 0 }, { "courseId": 2337437,
"className": "2337437-subClassName",
"assistantUids": [
1445886
],
"seatNum": 7,
"isHd": 1,
"isDc": 0,
"cameraHide": 0,
"isAutoOnstage": 1,
"liveState": 1,
"openState": 1,
"recordState": 1,
"recordType": 1,
"useCoMainRecord": 1
}
]
}
- Shell cURL simulation request instruction
curl -X POST \
-H 'Host: root_url' \
-H 'X-EEO-SIGN: 43a81ec4d7b213d20912826d95ba381a' \
-H 'X-EEO-UID: 2669800' \
-H 'X-EEO-TS: 1732270810' \
-H 'Content-Type: application/json' \
-d '{"mainCourseId": 2337435, "mainClassId": 4157055, "subClassJson": [{"courseId": 2337436, "className": "2337436-subClassName", "seatNum": 7, "isHd": 2, "isDc": 0, "cameraHide": 0, "isAutoOnstage": 1, "liveState": 1, "openState": 1, "recordState": 1, "recordType": 0, "useCoMainRecord": 0}, {"courseId": 2337437, "className": "2337437-subClassName", "assistantUids": [1445886], "seatNum": 7, "isHd": 1, "isDc": 0, "cameraHide": 0, "isAutoOnstage": 1, "liveState": 1, "openState": 1, "recordState": 1, "recordType": 1, "useCoMainRecord": 1}]}' \
'https://root_url/lms/onlineDoubleTeacher/addClass'
Response example (example of json
data packet returned)
{
"code": 1,
"msg": "程序正常执行",
"data": {
"mainClassId": 4157055,
"mainCourseId": 2337435,
"subClassData": [
{
"classId": 4157912,
"courseId": 2337436,
"className": "2337436-subClassName",
"liveUrl": "https://www.eeo.cn/live.php?lessonKey=7a32f568ed7b725c",
"liveInfo": {
"FLV": "https://liveplay.eeo.cn/eeolive/576f5a8ccf87-18329106c1ec9c2d2.flv?txSecret=57bd3671122a2e22a2fe306e8af2a0dd&txTime=7d8d37cd",
"HLS": "https://liveplay.eeo.cn/eeolive/576f5a8ccf87-18329106c1ec9c2d2.m3u8?txSecret=57bd3671122a2e22a2fe306e8af2a0dd&txTime=7d8d37cd",
"RTMP": "rtmp://liveplay.eeo.cn/eeolive/576f5a8ccf87-18329106c1ec9c2d2?txSecret=57bd3671122a2e22a2fe306e8af2a0dd&txTime=7d8d37cd"
},
"uniqueIdentity": "",
"code": 1,
"msg": "程序正常执行"
},
{
"classId": 4157913,
"courseId": 2337437,
"className": "2337437-subClassName",
"liveUrl": "",
"liveInfo": {},
"uniqueIdentity": "",
"code": 1,
"msg": "程序正常执行"
}
]
}
}
Error code description
Error code |
Description |
104 |
Unknown error |
124 |
The class time cannot be changed within one minute before the class starts |
136 |
There is no teacher under the institution, please add the teacher under the institution |
140 |
The class is in progress and cannot be edited or deleted |
142 |
There is no information about this single class under this course |
143 |
There is no information about this single class |
144 |
There is no course under this institution |
145 |
This single class has ended |
147 |
There is no information about this course |
149 |
This course has been deleted |
153 |
This course has expired |
153 |
This course has expired |
153 |
This course has expired |
165 |
A single class cannot be less than 15 minutes and cannot exceed 24 hours |
172 |
Students under the course cannot be added as teachers |
173 |
Auditors under the course cannot be added as teachers |
212 |
The course has been deleted |
212 |
The course has been deleted |
219 |
Teacher information does not exist |
221 |
The client failed to modify the video on demand information of the course |
222 |
The client failed to modify the information of the course |
226 |
The live playback status of the unrecorded course cannot be modified |
269 |
The course information is incorrect, please delete and recreate it |
318 |
The co-teacher is not a teacher of this institution |
318 |
The co-teacher is not a teacher of this institution |
319 |
Students under the course cannot be added as co-teachers |
320 |
Auditors under the course cannot be added as co-teachers |
322 |
The course teacher cannot be added as a co-teachers |
324 |
Failed to add the co-teacher to the teacher list |
325 |
Transfer students cannot be added as teachers |
326 |
Failed to add the co-teacher to the teacher list |
328 |
Co-teacher cannot be added as a teacher |
350 |
The class name, class time, cloud disk resources, number of people on stage, etc. cannot be modified within 20 minutes before the class starts |
368 |
The current number of students on stage does not support HD |
385 |
The class end time has passed, and the teaching teacher or co-teacher cannot be modified |
387 |
The teacher has been deactivated |
388 |
The co-teacher has been deactivated |
450 |
The number exceeds the limit |
451 |
Failed to add the class live cover and introduction |
451 |
Failed to add the class live cover and introduction |
454 |
The class start and end time overlap with the system maintenance time |
767 |
The class end time of the current version is not allowed to exceed the service period |
769 |
Teacher version or teacher trial version, the class teacher is not the teacher |
800 |
The teacher is suspended |
804 |
The co-teacher is suspended |
808 |
This setting does not support dual cameras |
863 |
The class duration does not meet the regulations |
875 |
The class name, class time, cloud disk resources, number of people on the stage, classroom mode, etc. cannot be modified within 5 minutes before the class starts |
884 |
The teacher account has been cancelled |
885 |
The co-teacher account has been cancelled |
21304 |
Non-primary and secondary schools do not support setting subjects |
21305 |
The subject does not exist |
21317 |
The number of co-teachers exceeds the limit |
21319 |
The teacher has been deleted |
101002005 |
Signature abnormality |
101002006 |
Timestamp expired |
101002008 |
Timestamp does not exist |
121601005 |
Webpage live broadcast is not supported |
121601006 |
Recording site is not supported |
121601008 |
Co-teacher is not supported |
121601009 |
Webpage playback is not supported |
121601010 |
Recording classroom is not supported |
121601011 |
Dual-camera mode is not supported |
121601012 |
Clarity exceeds the limit |
121601020 |
Business parameter error |
121601022 |
The course is not a standard course |
121601030 |
Maximum number of creations at one time is exceeded |
121601031 |
The course does not belong to the institution |
121601032 |
Unauthorized operation |
121601033 |
Classroom processing failed |
121601034 |
This operation is not supported for non-online dual-teacher classes |
121601035 |
The length of the class name cannot exceed 50 |