Create Class(Single)

Need to provide SID, safekey, timeStamp, course ID, class name, class start time, class end time, teacher's ID, teacher name, cloud dirve directory ID, and details of the students,co-teacher,Whether the power,Whether the hd、A unique identifier、Class introduction、The teacher UID、Ta UID。Among them SID、safeKey、timeStamp、courseId、className、beginTime、endTime、teacherAccount、teacherName are mandatory. Returns the class ID after the creation and the instructions after execution.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. After the unique identity is passed by the mechanism, the interface will verify whether there is this unique identity in all created classes under the mechanism,If so, the class ID that was created successfully before is returned.If not, execute normally.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.

Notes:

  • If class recording is set (live streaming is not set), more_data returns the live streaming player address of the 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 add account、nickname、checkCode joining together in https://live.eeo.cn/live_partner.html?lessonKey=00d1c98a91c52568 behind the address。 Note: this free secondary login address is not the same address as the live player address
  • 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 keys
    • lessonKey can be obtained from the broadcast address
    • account is student account,nickname is student nickname
    • checkCode = md5(secret+lessonKey+account+nickname)
  • Example URL splicing
    • 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=addCourseClass

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
className Yes Null Class name Null
beginTime Yes The course must start within 3 years Class start time begin time value = Unix Epoch timeStamp
endTime Yes Null Break time end time value = Unix Epoch timeStamp
teacherUid Yes Null Teacher UID The user UID returned by the user register interface
folderId No The default is the folderId of the course Cloud drive directory ID Null
seatNum No default is 6,maximum upper limit is 12 Number of students on stage Null
assistantUid No 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 No 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
record No Default 0 ,All non-1 Numbers,It's going to be treated as 0 Record the class(0 close,1 open) Null
recordScene No 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 No Default 0 ,All non-1 Numbers,It's going to be treated as 0 Live stream(0 close,1 open) Null
replay No Default 0 ,All non-1 Numbers,It's going to be treated as 0 Playback(0 close,1 open) Null
isAutoOnstage No 0=auto,1=Don't auto,Default is 0,Any number that's not a 1, it's treated as a 0 Whether students enter the classroom automatically Null
isHd No 0=The hd ,1=hd,2=Full hd,The default is 0,All non-zero Numbers, not including 1, are treated as 0 Whether the hd Currently only 1V1 or 1V6 hd, full hd
courseUniqueIdentity No For example: 45s8d5a6asaa1ssf (1-32 bit characters, non-conforming value interface will return 100 errors) Unique identity mechanism can pass a unique identity. After this value is passed in, we will verify whether this unique identity is present in all created classes under the mechanism
classIntroduce No 0-1000 words, no distinction between Chinese and English, more than 1000 words will automatically cut into 1000 words. Course introduction No
watchByLogin No Default 0 ,No or no, default values are used Only after logging into ClassIn account is allowed to watch, without logging in cannot watch,0=Did not open,1=open Two or more items of course record, live and replay are not enabled, and this parameter is not used
allowUnloggedChat No Default 1 ,No or no, default values are used Unlogged users are allowed to participate in live chat and thumb up,0=Don't allow,1=allow Class record and live are not enabled. This parameter is not used

Response data

Key Type Sample value meaning
data number 1340801 Create the class ID returned successfully
 └ 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.
error_info object Return message object
└ errno number 1 Error code
└ error string "Program normal execution" Error list

Sample

  • HTTP request
POST /partner/api/course.api.php?action=addCourseClass HTTP/1.1
Host: www.eeo.cn
Content-Type: application/x-www-form-urlencoded
Cache-Control: no-cache

SID=2339736&safeKey=e2f53f7a1b51bc86e52bbd080d8bf0f0&timeStamp=1493350659&courseId=490583&className=Chinese-10&beginTime=1493607694&endTime=1493609694&teacherUid=1001001&teacherName=Danma&folderId=&seatNum=6&record=1&live=0&replay=1&assistantUids=[1001002,100004]&isAutoOnstage=0&isHd=0&courseUniqueIdentity=54421&classIntroduce=ClassIn,真正的在线教室
  • Shell cURL analog request instruction

    curl -H "Content-Type: application/x-www-form-urlencoded" -X "POST" \
         -d "SID=1234567" \
         -d "safeKey=0f7781b3033527a8cc2b1abbf45a5fd2" \
         -d "timeStamp=1484719085" \
         -d "courseId=442447" \
         -d "className=测试课节-1" \
         -d "beginTime=1492506000" \
         -d "endTime=1492507800" \
         -d "teacherUid=1001001" \
         -d "teacherName=教师" \
         -d "folderId=22418" \
         -d "seatNum=6" \
         -d "record=1" \
         -d "live=1" \
         -d "replay=1" \
         -d "assistantUids=[100100,100101]" \
         -d "isAutoOnstage=0" \
         -d "isHd=0" \
         -d "courseUniqueIdentity=4565234" \
         -d "classIntroduce=ClassIn,真正的在线教室" \
         "https://api.eeo.cn/partner/api/course.api.php?action=addCourseClass"
    

Response sample(The normal return json packet example)

{
  "data": 23623,
  "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"
        }
    },
  "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.
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 No information about this course.
149 The course has been deleted.
153 The course is expired.
160 Your institution does not have the directory/folder in its cloud disk.
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.
259 The number of students on stage exceeds the maximum 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.
323 Co-teachers failed to purchase lessons.
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 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 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.

results matching ""

    No results matching ""