Tạo/sửa/xóa tag lớp học

Mục lục

Để 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 #

KeyBắt buộcMore RestrictionsInstructionsDescription
SIDBắt buộcID của trườngXem dữ liệu này tại Trang quản lý classin.com trong mục API
safeKeyBắt buộcFixed 32-bit all lowercase charactersKhóa bảo mật xác thực trường họcsafeKey=MD5(SECRET+timeStamp)
timeStampBắt buộcTheo Unix Epoch timestamp & có hiệu lực trong vòng 20 phútThờ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
courseIdBắt buộcCourse ID
classListBắt buộcDanh sách lớp họcJSON format
 └Bắt buộcClass Object
  └ customColumnKhông bắt buộcUser-defined fields.
  └ classIdBắt buộcClass ID
  └ classLabelIdKhông bắt buộclabel ID arrayKhi 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ạngPhản hồiÝ nghĩa
dataarray[]Return information array
 └object Return information object
  └ customColumnstring1Custom field
  └ classIdnumber288352Class ID
  └ errnonumber1Error code
  └ errorstringProgram normal executionError List
 └object Return information object
  └ customColumnstring1Custom field
  └ classIdnumber288352Class ID
  └ errnonumber1Error code
  └ errorstringProgram normal executionError List
error_infoobject Return information array
 └ errnonumber1Error code
 └ errorstring“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 CodeDescription
1Thành công
100Parameters sai định dạng hoặc không hoàn chỉnh
102Không có quyền thao tác (Xác thực bảo mật thất bại)
104Thao tác không thành công (lỗi không xác định)
155Danh sách không được để trống
144Không có khóa học này trong trường
149Khóa học này đã bị xóa
147Không có thông tin về khóa học
212Lớp học đã bị xóa
142Không có lớp học này trong khóa học
143Không có thông tin về lớp học
358Một số thẻ không tồn tại hoặc đã bị xóa
359Một số thẻ không tồn tại trong trường
357Số lượng thẻ gắn cho khóa học đã vượt quá giới hạn tối đa
369Lớp học công khai không hỗ trợ điều chỉnh
466Lớ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