Add/Edit/Detele Class Label

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. 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 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

  • 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 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.
149 The course has been deleted.
147 There is no information about the course.
212 The lesson has been deleted.
142 There is no information about the lesson in the course.
143 There is no information about this lesson.
358 Some labels do not exist or have been deleted.
359 Some labels do not belong to the institution.
357 Exceeded the maximum number of labels allowed to be added to the lesson.
369 Do not support to operate this type of courses and lessons(public course).
466 The lesson was created in the ClassIn LMS and cannot be edited via API. Please edit the lesson in the ClassIn LMS.

results matching ""

    No results matching ""