Add/Edit/Detele Course Label
The API call requires SID, safeKey, timeStamp, courseId and courseList. Pass an empty label array(labelIds) to delete all the course labels. When the course has no labels, pass label ID in the field of label array(labelIds) to add a label to the course. When the course label exists, pass label ID in the parameter of label array(labelIds) to modify the course label. The API call returns error info after execution. Note: A maximum of 10 labels can be added to each course.
URL
https://api.eeo.cn/partner/api/course.api.php?action=addCourseLabels
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 |
CourseList |
Yes |
Null |
Course array |
JSON format |
└ |
Yes |
Null |
Course Object |
Null |
└ customColumn |
No |
Null |
User-defined fields. |
Null |
└ CourseId |
Yes |
Null |
Course ID |
Null |
└ labelIds |
No |
Null |
label ID array |
An empty array indicates the full label of the delete Course. |
Response Parameters
Key |
Type |
Sample Value |
Meaning |
data |
array |
[] |
Return information array |
└ |
object |
|
Return information object |
└ customColumn |
string |
1 |
Custom field |
└ CourseId |
number |
288352 |
Course ID |
└ errno |
number |
1 |
Error code |
└ error |
string |
Program normal execution |
Error List |
└ |
object |
|
Return information object |
└ customColumn |
string |
1 |
Custom field |
└ CourseId |
number |
288352 |
Course 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=addCourseLabels HTTP/1.1
www.eeo.cn
application/x-www-form-urlencoded
no-cache
SID=2339736&safeKey=e98b01228fca036bf2ab060f7a8a6ec3&timeStamp=1493725870&CourseList=[{"customColumn":"1","CourseId":135120,"labelIds":[2,6,8]},{"customColumn":"2","CourseId": 135121,"labelIds": [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 'CourseList=[{"customColumn":"1","CourseId":135120,"labelIds":[2,6,8]},{"customColumn":"2","CourseId":135121,"labelIds":[4,7,12]}]' \
"https://api.eeo.cn/partner/api/course.api.php?action=addCourseLabels"
Response Sample(The normal return json
packet example)
{
"data": [
{
"customColumn": "1",
"CourseId": 288325,
"errno": 1,
"error": "程序正常执行"
},
{
"customColumn": "2",
"CourseId": 288323,
"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). |
155 |
Array data cannot be null. |
144 |
There is no such course in your institution. |
147 |
There is no information about the course. |
149 |
The course has been deleted. |
358 |
Some labels do not exist or have been deleted. |
359 |
Some labels do not belong to the institution. |
399 |
Exceed the maximum number of course labels. |