Create Lessons(Multiple)
To create lessons in batch, need 'SID, safekey, timeStamp, class ID, class name, class time, teacher account, teacher name, cloud disk directory ID, number of student attendance, class recording, live broadcast, playback, unique identification, class introduction, teacher UID, co-teacher UID', etc.Returns the class ID created, the class name, the error code for creating the class, and the error description.
Note: Currently, only 1v1 or 1v6 hd and full hd are supported, so the number of people who choose hd can only choose 1 or 6. It is recommended that no more than 30 lessons be created at one time.
Users can pass custom fields, and the interface returns the parameters as-is. No pass, no return.After the unique identity is passed in by the mechanism, the interface verifies whether there is such a unique identity in all created classes under the mechanism, and if so, returns the class ID that was successfully created before.If not, execute normally.
Note:
- if class recording is set for class (live streaming is not set), more_data returns the address of the live streaming player for class, and the pull stream address is empty;
- If a class is set to record and broadcast, three pull stream addresses (RTMP, HLS and FLV) will be bound to the class, and more_data will return the live player address and pull stream address of the class (these three addresses will still exist and be bound to the class regardless of whether the live broadcast of the class is cancelled or not).
- When the session is not recorded, the session live player address and pull stream address in more_data are empty.
- To enable the recording of the on-the-spot scene, please turn on the record function first, otherwise, the recording of the on-the-spot scene is not available.
The following comparison is for reference only.
RTMP | HLS | FLV(HTTP-FLV) | |
---|---|---|---|
The full name | Real Time Message Protocol | HTTP Liveing Streaming | RTMP over HTTP |
agreement | Long TCP connection | Short HTTP connection | Long HTTP connection |
The principle of | Data at each moment is forwarded as soon as it is received | Collect data for a period of time, generate ts slice files (three slices), and update the m3u8 index | With RTMP, using HTTP protocol (port 80) |
Time delay | 1-3s | 5-20s(depending on the slice) | 1-3s |
Web support | Plug-ins are required in H5 | Support the H5 | Plug-ins are required in H5 |
other | Cross-platform support is poor, need Flash technical support | Playback needs multiple requests, high quality requirements for the network | Need Flash technical support, do not support multi-audio stream, multi-video stream, not easy to seek (i.e. drag progress bar) |
In the live player page of the returned lesson, we implanted the chat room function.In order to facilitate you to collect the information of potential customers, all users need to fill in their mobile phone Numbers before they can chat, as shown in the figure below.Of course, in order to make it more convenient for you to use this function, we provide all students in your institution without logging in, please refer to the following
The chat room in the live player is exempted from secondary login
- After you get the player link through this interface
- Example:
https://www.eeo.cn/live.php?lessonKey=1ca102d29e61175f
- you need
account、nickname、checkCode
Joining together inhttps://live.eeo.cn/live_partner.html?lessonKey=00d1c98a91c52568
After the address. Note: this free secondary login address is not the same address as the live player address
- Example:
- The specific parameters and rules are as follows
- Specific parameters are
secret, lessonKey, account, nickname, checkCode
- secret is SECRET,Available at the eeo.cn API for docking keysl
- lessonKey can be obtained from the broadcast address
- account is student account,nickname is student nickname
- checkCode = md5(secret+lessonKey+account+nickname)
- Specific parameters are
- URL Stitching sample
https://live.eeo.cn/live_partner.html?lessonKey=00d1c98a91c52568&account=13700000000&nickname=classin&checkCode=d8c57caf088529b4ddd15b0f694d847b
URL
https://api.eeo.cn/partner/api/course.api.php?action=addCourseClassMultiple
HTTP Request Methods
- POST
Coding format
- UTF-8
Request data
key | Required | More Restrictions | Instructions | Description |
---|---|---|---|---|
SID | Yes | Null | School ID | It is available through the eeo.cn application |
safeKey | Yes | Fixed 32-bit all lowercase characters | School authentication security key | safeKey=MD5(SECRET+timeStamp) |
timeStamp | Yes | Null | Imestamp used by safeKey | Unix Epoch timeStamp is the number of seconds passed by 00:00 (world standard time) on January 1, 1970 |
courseId | Yes | Null | Course ID | Null |
classJson | Yes | Null | Class information array | Null |
└ Class information | Yes | Null | Lesson information to create | Null |
└ className | Yes | 1-50 words, no distinction between Chinese and English, more than 50 words will automatically cut into 50 words | Class name | Null |
└ beginTime | Yes | The course must start within 3 years | Class start time | begin time value = Unix Epoch timeStamp |
└ endTime | Yes | Null | Class end time | end time value = Unix Epoch timeStamp |
└ teacherUid | Yes | Null | Teacher's UID | The user UID returned by the user register interface |
└ folderId | Null | The default is folderId for the course | Cloud disk directory ID | There is no |
└ seatNum | Null | The default is 6, and the maximum upper limit is adjusted to 12 | Students count on the computer | There is no |
└ record | Null | The default is 0, and all non-1 Numbers are treated as 0 | Recording (0 closed, 1 open) | If you need live broadcast or playback, you must choose to record the lesson, otherwise you cannot open live broadcast or playback |
└ recordScene | Null | The default value is 0. All numbers other than 1 will be treated as 0. | Record on-the-spot scene(0 deactivate,1 activate) | After activating the function, the scene of the teacher's camera will be recorded. The recorded scene is available for website live broadcast and webpage replay. The prerequisite of recording the on-the-spot scene is to turn on the record function, otherwise, the parameter passed in recordScene would be invalid. |
└ live | Null | The default is 0, and all non-1 Numbers are treated as 0 | Live broadcast (0 off, 1 on) | If you want to live, you must start recording |
└ replay | Null | The default is 0, and all non-1 Numbers are treated as 0 | Playback (0 off, 1 on) | If playback is required, recording must be enabled |
└ assistantUid | Null | Choose one in assistantUids and assistantUid to pass the parameter.Either not pass this parameter or pass UID. Please do not pass an empty parameter. | Co-teacher UID | User's UID returned by calling registered user interface |
└ assistantUids | Null | Choose one in assistantUids and assistantUid to pass the parameter.Either not pass this parameter or pass UID array in JSON and Int. Please do not pass an empty parameter. Can pass just one co-teacher array. | Co-teacher UID array | User's UID returned by calling registered user interface |
└ customColumn | Null | 1-50 characters, more than will automatically intercept to 50 words | User - defined identity | If it is not empty, it is returned as is; if it is empty, the field is not returned |
└ isAutoOnstage | Null | 0= auto, 1= not auto, default is 0, all non-1 Numbers are treated as 0 | Whether students enter the classroom automatically | No |
└ isHd | Null | 0= non-hd, 1= hd, 2= full hd, default is 0, all non-0 digits over 1 are treated as 0 | Whether the hd | Currently only 1V1 or 1V6 hd, full hd |
└ courseUniqueIdentity | Null | For example: 45s8d5a6asaa1ssf (1-32 bit characters, non-conforming value interface will return 100 errors) | A unique identifier | A unique identity can be passed by the school, and once this value is passed in, we will verify that the unique identity is present in all created classes under the school |
└ classIntroduce | Null | 0-1000 words, no distinction between Chinese and English, more than 1000 words will automatically cut into 1000 words. | Class introduction | No |
└ ...... | Null | No | Lesson information to create | No |
Response data
Key | Type | Sample value | meaning |
---|---|---|---|
data | array | [] | Returns an array of Data information |
└ data | number | 1369235 | Class ID added |
└ className | string | 测试课节-1 | Added class name |
└ customColumn | string | 123 | User - defined identity |
└ more_data | array | [] | Returns an array of Data information |
└ live_url | string | https://www.eeo.cn/live.php?lessonKey=0fdc12bc3558164d | Lesson live player address |
└ live_info | array | [] | Returns an array of Data information |
└ RTMP | string | "rtmp://liveplay.eeo.cn/eeolive/576f5a8c97d9-183291632119a96?txSecret=f4bfe1afcf2592de61c11af9e0954c00&txTime=7d8d37cd" | The pull flow address for live streaming. |
└ HLS | string | "https://liveplay.eeo.cn/eeolive/576f5a8c97d9-183291632119a96.m3u8?txSecret=f4bfe1afcf2592de61c11af9e0954c00&txTime=7d8d37cd" | The pull flow address for live streaming. |
└ FLV | string | "https://liveplay.eeo.cn/eeolive/576f5a8c97d9-183291632119a96.flv?txSecret=f4bfe1afcf2592de61c11af9e0954c00&txTime=7d8d37cd" | The pull flow address for live streaming. |
└ data | number | 1369235 | Add class ID |
└ className | string | Test class-1 | Add the class name |
└ errno | number | 1 | Error code for this class |
└ error | string | "Normal execution" | Error list for this class |
error_info | object | Return message object | |
└ errno | number | 1 | Error code |
└ error | string | "Program normal execution" | Error list |
Sample
- HTTP request ```http POST /partner/api/course.api.php?action=addCourseClassMultiple HTTP/1.1 Host: www.eeo.cn Content-Type: application/x-www-form-urlencoded Cache-Control: no-cache
SID=2339736&safeKey=5458edceccc78c6698de624e94364285&timeStamp=1493026245&courseId=469383&classJson=[{"className":"Chinese Test-1","beginTime":1493026245,"endTime":1493036245,"teacherUid":"23692341090","teacherName":"Jeck","folderId":714013,"seatNum":4,"customColumn":123,"isAutoOnstage":0,"isHd":0,"courseUniqueIdentity":457354},{"className":"Chinses Test-2","beginTime":1493026245,"endTime":1493036245,"teacherUid":"23692341090","teacherName":"Mary","folderId":714013,"seatNum":6,"customColumn":124,"isAutoOnstage":0,"isHd":0,"courseUniqueIdentity":457354,"classIntroduce ":"ClassIn,真正的在线教室"}]
- Shell cURL analog request instruction
```bash
curl -H "Content-Type: application/x-www-form-urlencoded" -X "POST" \
-d "SID=1234567" \
-d "safeKey=0f7781b3033527a8cc2b1abbf45a5fd2" \
-d "timeStamp=1484719085" \
-d "courseId=442447" \
-d 'classJson= \
[ \
{ \
"className":"测试课节-1", \
"beginTime":1493029525, \
"endTime":1493039525, \
"teacherUid":"1001001",\
"teacherName":"教师1",\
"seatNum":4,\
"record":1,\
"live":0,\
"replay":1,\
"assistantUids": [1001002,1001003,1001004],\
"isAutoOnstage":"0", \
"isHd":"0", \
"courseUniqueIdentity":123457 \
"classIntroduce":"ClassIn,真正的在线教室" \
},\
{\
"className":"测试课节-2",\
"beginTime":1493029525,\
"endTime":1493039525,\
"teacherUid":"1001002",\
"teacherName":"教师2",\
"seatNum":4,\
"record":1,\
"live":1,\
"replay":1,\
"assistantUids": [1001002,1001003,1001004],\
"isAutoOnstage":"0", \
"isHd":"0",\
"courseUniqueIdentity":1234575 \
"classIntroduce":"ClassIn,真正的在线教室" \
}\
]' \
"https://api.eeo.cn/partner/api/course.api.php?action=addCourseClassMultiple"
Response sample(The normal return json
packet example)
{
"data": [
{
"data": 23634,
"className": "测试课节-1",
"customColumn": "123",
"more_data": {
"live_url": "https://www.eeo.cn/live.php?lessonKey=0fdc12bc3558164d",
"live_info": {
"RTMP": "rtmp://liveplay.eeo.cn/eeolive/576f5a8c97d9-183291632119a96?txSecret=f4bfe1afcf2592de61c11af9e0954c00&txTime=7d8d37cd",
"HLS": "https://liveplay.eeo.cn/eeolive/576f5a8c97d9-183291632119a96.m3u8?txSecret=f4bfe1afcf2592de61c11af9e0954c00&txTime=7d8d37cd",
"FLV": "https://liveplay.eeo.cn/eeolive/576f5a8c97d9-183291632119a96.flv?txSecret=f4bfe1afcf2592de61c11af9e0954c00&txTime=7d8d37cd"
}
},
"errno": 1,
"error": "程序正常执行"
},
{
"data": 23635,
"className": "测试课节-2",
"customColumn": "124",
"more_data": {
"live_url": "https://www.eeo.cn/live.php?lessonKey=0fdc12bc3558164d",
"live_info": {
"RTMP": "rtmp://liveplay.eeo.cn/eeolive/576f5a8c97d9-183291632119a96?txSecret=f4bfe1afcf2592de61c11af9e0954c00&txTime=7d8d37cd",
"HLS": "https://liveplay.eeo.cn/eeolive/576f5a8c97d9-183291632119a96.m3u8?txSecret=f4bfe1afcf2592de61c11af9e0954c00&txTime=7d8d37cd",
"FLV": "https://liveplay.eeo.cn/eeolive/576f5a8c97d9-183291632119a96.flv?txSecret=f4bfe1afcf2592de61c11af9e0954c00&txTime=7d8d37cd"
}
},
"errno": 1,
"error": "程序正常执行"
}
],
"error_info": {
"errno": 1,
"error": "程序正常执行"
}
}
Error Code Description
Error Code | Description |
---|---|
1 | Successful execution. |
100 | Incomplete or incorrect parameters. |
102 | No permission(Security verification failed.). |
104 | Operation failed(unknown error). |
114 | Server exception. |
119 | The lesson end time must be later than the lesson start time. |
120 | The lesson must start at least one minute after the current time. |
122 | The format of the teacher's account is incorrect. |
133 | The lesson already exists(There are repeated courseUniqueIdentity in the classJson passed.). |
136 | There is no such teacher in your institution. Please add the teacher to your institution first. |
144 | There is no such course in your institution. |
147 | There is no information about this course. |
149 | The course has been deleted. |
153 | The course is expired. |
155 | Array data cannot be null. |
160 | Your institution does not have this directory/folder in its cloud disk. |
161 | The creation of a single lesson failed. |
165 | The lesson duration shall not be less than 15 minutes and not more than 24 hours. |
172 | Course students cannot be set as teachers when creating lessons. |
173 | Course auditing students cannot be set as teachers when creating lessons. |
220 | Failed to create lessons through the app. |
259 | The number of students on stage exceeds the limit. |
268 | The lesson start time exceeds the valid range(The start time must be within 3 years). |
280 | The lesson was created successfully, but the classroom-recording parameter is incorrect. Thus the recording function is not activated. |
281 | The lesson was created successfully. There is problems with the video service, and the recording function is not activated. |
318 | The co-teacher is not a teacher in your institution. |
319 | Course students cannot be set as co-teachers. |
320 | Course auditing students cannot be set as co-teachers. |
322 | Lesson teachers can't be set as co-teachers. |
324 | The lesson teacher failed to be added to the teacher list. |
326 | The co-teacher failed to be added to the teacher list. |
330 | The format of co-teacher's account is incorrect(This error code was removed in April 2022.). |
368 | The number of students on stage does not support HD cameras. |
369 | The course/lesson of this type(public course) cannot be operated. |
387 | The teacher is deactivated. |
388 | The co-teacher is deactivated. |
398 | The data already exists (The same courseUniqueIdentity already exists.). |
400 | The requested data is not valid. |
454 | The start and end time of a lesson overlaps with the system maintenance time. |
460 | The course or class(lesson) is being created by another request.The same courseUniqueIdentity is used to create course/class(lesson) at the same time(within 1 second). |
800 | The teacher is suspended. |
804 | The co-teacher is suspended. |
824 | The lesson was created successfully, but the setting of the lesson introduction failed. |
808 | Do not support to set dual cameras for the lesson. |
884 | The teacher's account has been deleted by the user. |
885 | The co-teacher's account has been deleted by the user. |
21316 | The data of co-teachers are duplicated. |
21317 | The number of co-teachers exceeds the limit. |
121601001 | There are settings that are not supported by the current version. |
121601002 | Operation successful! The usage limit for [online classroom] resources has been surpassed. To avoid any negative consequences, please reach out to your account manager immediately. |
121601003 | You have exceeded the monthly limit for creating lessons. To continue creating lessons, please upgrade your account to access additional benefits. |
121601004 | You have reached the monthly limit for creating lessons and cannot continue creating more. |
121601005 | Not supported for configuring web-based live streaming. |
121601006 | Not supported for setting up cloud recording for On-the-spot Scene. |
121601007 | Error with the number of people on stage parameter. |
121601008 | Not supported for setting up co-teachers. |
121601009 | Not supported for web-based classroom playback. |
121601010 | Not supported for setting cloud recording. |
121601011 | Not supported for setting dual-camera mode. |
121601012 | Resolution exceeds limit. |