Tạo lớp học (Lesson)

Mục lục

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.

RTMPHLSFLV(HTTP-FLV)
The full nameReal Time Message ProtocolHTTP Liveing StreamingRTMP over HTTP
agreementLong TCP connectionShort HTTP connectionLong HTTP connection
The principle ofData at each moment is forwarded as soon as it is receivedCollect data for a period of time, generate ts slice files (three slices), and update the m3u8 indexWith RTMP, using HTTP protocol (port 80)
Time delay1-3s5-20s(depending on the slice)1-3s
Web supportPlug-ins are required in H5Support the H5Plug-ins are required in H5
otherCross-platform support is poor, need Flash technical supportPlayback needs multiple requests, high quality requirements for the networkNeed 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 #

keyRequiredMore RestrictionsInstructionsDescription
SIDYesNullSchool IDIt is available through the eeo.cn application
safeKeyYesFixed 32-bit all lowercase charactersSchool authentication security keysafeKey=MD5(SECRET+timeStamp)
timeStampYesNullImestamp used by safeKeyUnix Epoch timeStamp is the number of seconds passed by 00:00 (world standard time) on January 1, 1970
courseIdYesNullCourse IDNull
classNameYesNullClass nameNull
beginTimeYesThe course must start within 3 yearsClass start timebegin time value = Unix Epoch timeStamp
endTimeYesNullBreak timeend time value = Unix Epoch timeStamp
teacherUidYesNullTeacher UIDThe user UID returned by the user register interface
folderIdNoThe default is the folderId of the courseCloud drive directory IDNull
seatNumNodefault is 6,maximum upper limit is 12Number of students on stageNull
assistantUidNoChoose 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 UIDUser’s UID returned by calling registered user interface
assistantUidsNoChoose 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 arrayUser’s UID returned by calling registered user interface
recordNoDefault 0 ,All non-1 Numbers,It’s going to be treated as 0Record the class(0 close,1 open)Null
recordSceneNoThe default value is 0. All numbers other than 1 will be treated as 0Record 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.
liveNoDefault 0 ,All non-1 Numbers,It’s going to be treated as 0Live stream(0 close,1 open)Null
replayNoDefault 0 ,All non-1 Numbers,It’s going to be treated as 0Playback(0 close,1 open)Null
isAutoOnstageNo0=auto,1=Don’t auto,Default is 0,Any number that’s not a 1, it’s treated as a 0Whether students enter the classroom automaticallyNull
isHdNo0=The hd ,1=hd,2=Full hd,The default is 0,All non-zero Numbers, not including 1, are treated as 0Whether the hdCurrently only 1V1 or 1V6 hd, full hd
courseUniqueIdentityNoFor example: 45s8d5a6asaa1ssf (1-32 bit characters, non-conforming value interface will return 100 errors)Unique identitymechanism 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
classIntroduceNo0-1000 words, no distinction between Chinese and English, more than 1000 words will automatically cut into 1000 words.Course introductionNo
watchByLoginNoDefault 0 ,No or no, default values are usedOnly after logging into ClassIn account is allowed to watch, without logging in cannot watch,0=Did not open,1=openTwo or more items of course record, live and replay are not enabled, and this parameter is not used
allowUnloggedChatNoDefault 1 ,No or no, default values are usedUnlogged users are allowed to participate in live chat and thumb up,0=Don’t allow,1=allowClass record and live are not enabled. This parameter is not used

Response data #

KeyTypeSample valuemeaning
datanumber1340801Create the class ID returned successfully
 └ more_dataarray[]Returns an array of Data information
 └ live_urlstringhttps://www.eeo.cn/live.php?lessonKey=0fdc12bc3558164dLesson live player address
 └ live_infoarray[]Returns an array of Data information
  └ RTMPstring“rtmp://liveplay.eeo.cn/eeolive/576f5a8c97d9-183291632119a96?txSecret=f4bfe1afcf2592de61c11af9e0954c00&txTime=7d8d37cd”Pull flow address
  └ HLSstringhttps://liveplay.eeo.cn/eeolive/576f5a8c97d9-183291632119a96.m3u8?txSecret=f4bfe1afcf2592de61c11af9e0954c00&txTime=7d8d37cdPull flow address
  └ FLVstringhttps://liveplay.eeo.cn/eeolive/576f5a8c97d9-183291632119a96.flv?txSecret=f4bfe1afcf2592de61c11af9e0954c00&txTime=7d8d37cdPull flow address
error_infoobjectReturn message object
└ errnonumber1Error code
└ errorstring“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 CodeDescription
1Successful execution.
100Incomplete or incorrect parameters.
102No permission(Security verification failed.).
104Operation failed(unknown error).
114Server exception.
119The lesson end time must be later than the lesson start time.
120The lesson must start at least one minute after the current time.
136There is no such teacher in your institution. Please add the teacher to your institution first.
144There is no such course in your institution.
147No information about this course.
149The course has been deleted.
153The course is expired.
160Your institution does not have the directory/folder in its cloud disk.
165The lesson duration shall not be less than 15 minutes and not more than 24 hours.
172Course students cannot be set as teachers when creating lessons.
173Course auditing students cannot be set as teachers when creating lessons.
259The number of students on stage exceeds the maximum limit.
268The lesson start time exceeds the valid range(The start time must be within 3 years).
280The lesson was created successfully, but the classroom-recording parameter is incorrect. Thus the recording function is not activated.
281The lesson was created successfully. There is problems with the video service, and the recording function is not activated.
318The co-teacher is not a teacher in your institution.
319Course students cannot be set as co-teachers.
320Course auditing students cannot be set as co-teachers.
322Lesson teachers can’t be set as co-teachers.
323Co-teachers failed to purchase lessons.
324The lesson teacher failed to be added to the teacher list.
326The co-teacher failed to be added to the teacher list.
330The format of co-teacher’s account is incorrect(This error code was removed in April 2022.).
368The number of students on stage does not support HD cameras.
369The course/lesson of this type(public course) cannot be operated.
387The teacher is deactivated.
388The co-teacher is deactivated.
398The data already exists (The courseUniqueIdentity already exists.).
400The requested data is not valid.
454The start and end time of a lesson overlaps with the system maintenance time.
460The 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).
800The teacher is suspended.
804The co-teacher is suspended.
824The lesson was created successfully, but the setting of lesson introduction failed.
808Do not support to set dual cameras for the lesson.
884The teacher’s account has been deleted by the user.
885The co-teacher’s account has been deleted by the user.
21316The data of co-teachers are duplicated.
21317The number of co-teachers exceeds the limit.