Add/Edit/Detele Class Label
Edit School label,need SID,safekey,timeStamp,courseId,classList.If the tag array (classLabelId) is empty,represents delete class under all labels;when there is no label in the class.fill in the label ID,represents to add labels to the class;when there is label ID in the class,add label ID to the label array,represents edit label.return Information after execution.
URL
https://api.eeo.cn/partner/api/course.api.php?action=addClassLabels
HTTP Request Methods
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 |
classList |
Yes |
Null |
Class array |
JSON format |
└ |
Yes |
Null |
Class Object |
Null |
└ customColumn |
No |
Null |
User-defined fields. |
Null |
└ classId |
Yes |
Null |
Class ID |
Null |
└ classLabelId |
No |
Null |
label ID array |
An empty array indicates the full label of the delete class. |
Response parameters
key |
Type |
Sample value |
meaning |
data |
array |
[] |
Return information array |
└ |
object |
|
Return information object |
└ customColumn |
string |
1 |
Custom field |
└ classId |
number |
288352 |
Class ID |
└ errno |
number |
1 |
Error code |
└ error |
string |
Program normal execution |
Error List |
└ |
object |
|
Return information object |
└ customColumn |
string |
1 |
Custom field |
└ classId |
number |
288352 |
Class ID |
└ errno |
number |
1 |
Error code |
└ error |
string |
Program normal execution |
Error List |
error_info |
object |
|
Return information array |
└ errno |
number |
1 |
Error code |
└ error |
string |
"Program normal execution" |
Error List |
Sample
POST /partner/api/course.api.php?action=addClassLabels HTTP/1.1
www.eeo.cn
application/x-www-form-urlencoded
no-cache
SID=2339736&safeKey=e98b01228fca036bf2ab060f7a8a6ec3&timeStamp=1493725870&courseId=25684&classList=[{"customColumn":"1","classId":135120,"classLabelId":[2,6,8]},{"customColumn":"2","classId": 135121,"classLabelId": [4,7,12]}]
- 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=25684" \
-d 'classList=[{"customColumn":"1","classId":135120,"classLabelId":[2,6,8]},{"customColumn":"2","classId":135121,"classLabelId":[4,7,12]}]' \
"https://api.eeo.cn/partner/api/course.api.php?action=addClassLabels"
Response sample(The normal return json
packet example)
{
"data": [
{
"customColumn": "1",
"classId": 288325,
"errno": 1,
"error": "程序正常执行"
},
{
"customColumn": "2",
"classId": 288323,
"errno": 1,
"error": "程序正常执行"
}
],
"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 the operation failure(unknown error) |
155 |
Expression the data array must not is empty. |
144 |
Expression there is no such course under the school. |
149 |
Expression the course has been removed. |
147 |
Expression there is no information about this course. |
212 |
Expression the course has been deleted. |
142 |
Expression there is no information about this class under this course. |
143 |
Expression there is no such information. |
358 |
Expression labels tags do not exist or have been deleted. |
359 |
Expression some labels do not belong to this school. |
357 |
Expression beyond the limit. |
369 |
Expression open class does not support this operation. |