Create class(single)

Need to provide SID, safekey, timeStamp, course ID, class name, class time, break time, teacher's ID, teacher name, cloud dirve directory ID, and details of the students,teaching assistant,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.

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://api.eeo.cn/live.php?lessonKey=1ca102d29e61175f
    • You need add account、nickname、checkCode joining together in https://api.eeo.cn/live_partner.php?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://api.eeo.cn/live_partner.php?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 Null
endTime Yes Null Break time Null
teacherUid Yes Null Teacher UID The user UID returned by the user register interface
folderId No Default is the school's top-level directory Cloud driverdirectory ID Null
seatNum No default is 6,maximum upper limit is 12 Number of students Null
record No Default 0 ,All non-1 Numbers,It's going to be treated as 0 Record the class(0 close,1 open) Null
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
assistantUid No It must be the teacher of the institution that can be appointed as a teaching assistant. Ta UID The user UID returned by the user register interface
isAutoOnstage 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

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://api.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" Pull flow address
  └ HLS string "https://liveplay.eeo.cn/eeolive/576f5a8c97d9-183291632119a96.m3u8?txSecret=f4bfe1afcf2592de61c11af9e0954c00&txTime=7d8d37cd" Pull flow address
  └ FLV string "https://liveplay.eeo.cn/eeolive/576f5a8c97d9-183291632119a96.flv?txSecret=f4bfe1afcf2592de61c11af9e0954c00&txTime=7d8d37cd" Pull flow address
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&assistantUid=1001002&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 "assistantUid=1001002" \
         -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://api.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 instruction

Error code instruction
1 Expression successful execution.
100 Expression parameter not all or error.
102 Expression dont have permissions(Security verification failed).
104 Expression operation failure(Unknown error).
114 Expression server exception.
119 Expression the end time must be late.
120 Expression at least one minute after class.
136 Expression this account is not a teacher of the school.
144 Expression no such course information.
147 Expression no such course information.
149 Expression courses have been deleted.
153 Expression the course has expired.
160 Expression there is no cloud disk directory under the organization.
165 Means that a lesson should not be less than 15 minutes and not more than 24 hours,
172 Expression the students under the class cannot be added to the teacher.
173 Expression the audit of the class cannot be added to the teacher.
259 Expression number of people on stage exceeded the maximum limit.
268 Expression the starting time of class festival must be within three years.
280 Expression lesson section create success, record class parameter setting error, record class open failure.
281 Expression the class section is successful, video service has a problem, and the recording session fails.
318 Expression the teaching assistant is not a teacher of the institution.
319 Expression the students under the course cannot be added as teaching assistant.
320 Expression the attend under the course cannot be added as teaching assistant.
322 Expression the class teacher can't be added as a teaching assistant.
323 Expression teaching assistant fails to buy class.
324 Expression the teacher in class add teacher list fail.
326 Expression the teaching assistant in class add teacher list fail.
330 Expression the teaching assistant account format is not correct.
369 Expression open class does not support this operation.
387 indicates that the teacher has been suspended.
388 Indicates that the ta has been discontinued.
398 Indicates that the data already exists (a unique identity already exists)
400 Indicates that the request data is not valid
800 Means the teacher is out of use
804 The ta is out of use
824 Indicates that the session was added successfully, while the session introduction setting failed

results matching ""

    No results matching ""