Add Students/Auditing Students to Course (Multiple)
Add student / listener (multiple) under the course, need SID, safekey, timestamp, the course ID, the identification of the student or auditor (1 for the student, 2 for the listener), and the array of student or audience accounts to be added. The array includes the account number and account name of each account, and the student / Auditor uid. Return the details of each account added. The user can pass the custom field, and the interface will return the parameter as it is. If it is not passed, it will not be returned. Students added in the course can attend all the lessons in the course.
Note: The default maximum number of auditors is 20 people, and it is recommended that the number of students added at one time should not exceed 30 people.
URL
https://api.eeo.cn/partner/api/course.api.php?action=addCourseStudentMultiple
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 |
identity | Yes | Null | Student and audit identification(1 is student,2 is attend) | Null |
studentJson | Yes | A maximum of 20 people can be added to the audit | An array of accounts to be added | Null |
└ Student 1 account information | Yes | Null | Need to add student account information | Null |
└ name | Yes | Null | Student name | Null |
└ customColumn | No | 1-50 words,No distinction between Chinese and English,More than 50 will automatically intercept 50 words | User custom identity | Do not return as empty,The field is not returned for empty |
└ uid | No | Null | Students UID | Register the user UID returned by the user interface |
└ ······ | No | Null | Need to add student account information | Null |
└ name | Yes | Null | Student name | Null |
└ customColumn | No | 1-50 words,No distinction between Chinese and English,More than 50 will automatically intercept 50 words | User custom identity | Do not return as empty,The field is not returned for empty |
└ uid | No | Null | Students UID | Register the user UID returned by the user interface |
Response data
Key | Type | Sample Value | Meaning |
---|---|---|---|
data | array | [] | Returns an array of data information |
└ data Return message 1 | object | Return information object | |
└ customColumn | string | 123 | User - defined identity |
└ errno | number | 1 | The error code |
└ error | string | "程序正常执行" | Error details |
└ data Return message 2 | object | Return information object | |
└ customColumn | string | 123 | User - defined identity |
└ errno | number | 1 | The error code |
└ error | string | "程序正常执行" | Error details |
└ ······ | object | Return information object | |
└ customColumn | string | 123 | User - defined identity |
└ errno | number | ··· | The error code |
└ error | string | ··· | Error details |
error_info | object | Return information object | |
└ errno | number | 1 | The error code |
└ error | string | "Routine execution" | Error details |
Sample
- HTTP Request
POST /partner/api/course.api.php?action=addCourseStudentMultiple HTTP/1.1
Host: www.eeo.cn
Content-Type: application/x-www-form-urlencoded
Cache-Control: no-cache
SID=2339736&safeKey=e98b01228fca036bf2ab060f7a8a6ec3&timeStamp=1493725870&courseId=490583&identity=1&studentJson=[{"uid":"1001001","name":"Mary","customColumn":123}]
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 "identity=1" \ -d 'studentJson=[{"uid":"1001001","name":"学生一"},{"uid":"1002001","name":"学生二"}]' \ "https://api.eeo.cn/partner/api/course.api.php?action=addCourseStudentMultiple"
Response Sample (normal return json
packet sample)
{
"data": [
{
"customColumn": "123",
"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 failure(Unknown error). |
113 | The mobile phone number has not been registered yet. |
114 | Server exception. |
125 | The student's mobile phone number is illegal. |
129 | Course teachers cannot be set as students. |
130 | Exceeds the number of students that can be added. |
131 | Registration failed. |
133 | Already exists (The error will be reported when you pass repeated accounts.). |
134 | Illegal mobile phone number. |
144 | There is no such course in your institution. |
147 | There is no information about the course. |
149 | The course has been deleted. |
153 | The course is expired and cannot be edited. |
155 | Array data cannot be null. |
163 | The course student already exists. |
164 | The course auditing student already exists. |
174 | Teachers cannot be set as auditing students. |
228 | There is no such student in your institution. |
288 | The mobile phone number is illegal. |
332 | Course teachers or co-teachers cannot be set as course students or course auditing students. |
333 | The course advisor cannot be set as a course student. |
369 | Do not support to operate this type of courses and lessons(public course). |
400 | The requested data is illegal. |
841 | Successfully added students to the course. Failed to synchronize class nicknames. |
886 | The student's account has been deleted by the user. |
887 | The auditing student's account has been deleted by the user. |