Để thêm/sửa đổi/xóa thẻ lớp học, cần truyền tham số SID, safekey, timeStamp, CourseId, danh sách lớp học. Khi classLabelId trống, có nghĩa là xóa tất cả các thẻ trong phần lớp.
Lưu ý: Bạn có thể thêm tối đa 10 thẻ cho mỗi lớp học
The API call requires SID,safeKey,timeStamp, course ID and array of class(lesson) ID. Pass an empty data array of classLabelId to delete all labels of the lessons. When there is no label for the lesson, the label ID is filled in the label array (classlabel ID), indicating that a label is added to the lesson. When there is a label ID for the lesson , add a label ID to the label array (classlabel ID) to modify the label for the lesson. Returns the information after execution.
Note: A maximum of 10 labels can be added to each class(lesson)
URL
https://api.eeo.cn/partner/api/course.api.php?action=addClassLabels
HTTP Request Methods #
- POST
Coding Format #
- UTF-8
Request Data #
Key | Bắt buộc | More Restrictions | Instructions | Description |
---|---|---|---|---|
SID | Bắt buộc | — | ID của trường | Xem dữ liệu này tại Trang quản lý classin.com trong mục API |
safeKey | Bắt buộc | Fixed 32-bit all lowercase characters | Khóa bảo mật xác thực trường học | safeKey=MD5(SECRET+timeStamp) |
timeStamp | Bắt buộc | — | Theo Unix Epoch timestamp & có hiệu lực trong vòng 20 phút | Thời gian UNIX Epoch là số giây đã trôi qua kể từ 00:00:00 (giờ chuẩn quốc tế) vào ngày 1 tháng 1 năm 1970 |
courseId | Bắt buộc | — | Course ID | — |
classList | Bắt buộc | — | Danh sách lớp học | JSON format |
└ | Bắt buộc | — | Class Object | — |
└ customColumn | Không bắt buộc | — | User-defined fields. | — |
└ classId | Bắt buộc | — | Class ID | — |
└ classLabelId | Không bắt buộc | — | label ID array | Khi mảng trống, điều đó có nghĩa là xóa tất cả các thẻ trong khóa học |
Response Parameters #
Key | Định dạng | Phản hồi | Ý nghĩa |
---|---|---|---|
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 #
- HTTP Request
POST /partner/api/course.api.php?action=addClassLabels 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=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 Description #
Error Code | Description |
---|---|
1 | Thành công |
100 | Parameters sai định dạng hoặc không hoàn chỉnh |
102 | Không có quyền thao tác (Xác thực bảo mật thất bại) |
104 | Thao tác không thành công (lỗi không xác định) |
155 | Danh sách không được để trống |
144 | Không có khóa học này trong trường |
149 | Khóa học này đã bị xóa |
147 | Không có thông tin về khóa học |
212 | Lớp học đã bị xóa |
142 | Không có lớp học này trong khóa học |
143 | Không có thông tin về lớp học |
358 | Một số thẻ không tồn tại hoặc đã bị xóa |
359 | Một số thẻ không tồn tại trong trường |
357 | Số lượng thẻ gắn cho khóa học đã vượt quá giới hạn tối đa |
369 | Lớp học công khai không hỗ trợ điều chỉnh |
466 | Lớp học được tạo từ LMS không thể chỉnh sửa thông qua API. Vui lòng truy cập ứng dụng ClassIn hoặc Trang quản lý để chỉnh sửa |