Create course
To create the course, SID, safekey, timeStamp, course name, available folder ID, course cover picture (binary stream), expiration time, headteacher account, course introduction, classroom setting ID (mainly used to set classroom skin and other options), unique ID, headteacher UID;SID, safeKey, timeStamp and course name are required.The course ID and the instructions are returned.After the organization passes in a unique ID, the interface verifies that this unique ID is present in the created course, and if so, returns the ID of the previously created course.If not, execute normally.
URL
https://api.eeo.cn/partner/api/course.api.php?action=addCourse
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 | Timestamp used by safeKey | Unix Epoch timeStamp is the number of seconds passed by 00:00 (world standard time) on January 1, 1970 |
courseName | Yes | Null | coursename | Null |
folderId | No | Do not pass the default empty directory | Available resource folder ID | Null |
Filedata | No | Binary stream | The cover of the course | Null |
expiryTime | No | If the expiration time is not passed, pass 0 and pass 0 are all regarded as 0, and the expiration time of the course is set to never expire.If an expiry date is set, the expiry date can only be passed within 1 year of the current time | Expiration time | There is no |
courseIntroduce | No | Course introduction (Can be null),The length of the 0 ~ 400 words | Null | Null |
classroomSettingId | No | Default is 0 | Classroom setting ID | Classroom setting ID search method: log into the background of eeo.cn, find the institutional setting and classroom setting, and the classroom setting ID will be displayed for each set of classroom Settings;After selecting this set of Settings, all classrooms under the course will be displayed according to this setting. Classroom Settings include: a. classroom skin, b. switch Settings (toolbar below the head, chat window, student-side roster, after-class evaluation, classroom toolbox, cloud disk, etc.), c. parameter Settings (class countdown, classroom chat interval, etc.) |
courseUniqueIdentity | No | For example: 45s8d5a6asaa1ssf (1-32 bit characters, non-conforming value interface will return 100 errors) | A unique identifier | The organization can pass a unique identity, and once this value is passed in, we verify that it is present in the created course |
mainTeacherUid | YES | NULL | Headteacher UID | registers the user UID returned by the user interface |
Response data
Key | Type | Sample value | Meaning |
---|---|---|---|
data | number | 352861 | Create success returned course ID |
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=addCourse HTTP/1.1
Host: www.eeo.cn
Content-Type: application/x-www-form-urlencoded
Cache-Control: no-cache
SID=2339736&safeKey=f834fff59eb3bc8a2ff26a3cb59155f0&timeStamp=1492792399&courseName=Good+Day&folderId=22419&Filedata=@~/photo.jpg&expiryTime=1492795000&mainTeacherUid=1001001&courseIntroduce=ClassIn,真正专业的在线教室&classroomSettingId=235&courseUniqueIdentity=532512
- Shell cURL analog request instruction
curl -X "POST" \
-d "SID=1234567" \
-d "safeKey=0f7781b3033527a8cc2b1abbf45a5fd2" \
-d "timeStamp=1484719085" \
-d "courseName=Good Day" \
-d "folderId=22419" \
-d "Filedata=@~/photo.jpg" \
-d "expiryTime=1523428688" \
-d "mainTeacherUid=1001001" \
-d "courseIntroduce=ClassIn,真正专业的在线教室" \
-d "classroomSettingId=235" \
-d "courseUniqueIdentity=24545" \
"https://api.eeo.cn/partner/api/course.api.php?action=addCourse"
Response sample(The normal return json
packet example)
{
"data": 352861,
"error_info": {
"errno": 1,
"error": "程序正常执行"
}
}
Error code description
Error code | description |
---|---|
1 | expression successful execution. |
100 | expression parameter not all or error. |
102 | expression dont have permissions(Security verification failed). |
103 | expression Failed to upload file to server. |
114 | expression server exception. |
151 | expression at least one day after expiration. |
154 | expression the expiration time can only be within one year. |
160 | expression there is no cloud driver directory under the school. |
260 | expression add head teacher fail. |
331 | expression the head teacher's account format is not correct. |
334 | expression the head teacher does not exist |
371 | Indicates that the classroom setting does not exist |
373 | Indicates that the classroom setting is not part of the institution |
389 | expression The head teacher has been suspended |
398 | Indicates that the data already exists (a unique identity already exists) |
400 | Indicates that the request data is not valid |
805 | The head teacher is suspended |