Add Students to Lesson(Multiple)

Note: The API is to add students to the lesson in the role of transfer student, not course student. Transfer Students are not enrolled in the course, and can only attend the lessons they are added to. They cannot access the course functions, such as IM group chat, task and test.

To add multiple students to a lesson, you need to pass SID, safeKey, timeStamp, course ID, class ID, students' identity (1 is Student), and the students accounts array, including students' UID and students names. The request instruction for each student is returned.

You can pass value in the custom field, and the interface will return the parameter as it is. If it is not passed, it will not be returned.

You cannot add auditing students to lessons. Auditing students are added to the course.

Note: It is recommended that no more than 30 students be added at one time.

URL

https://api.eeo.cn/partner/api/course.api.php?action=addClassStudentMultiple

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
classId Yes Null Class ID Null
identity Yes Null Students identify(1 for the students) Null
studentJson Yes Null You need to add an account array Null
└ Student 1 account information object Yes Null You need to add student information objects Null
  └ uid Yes NULL student UID Register the user UID returned by the user interface
  └ name Yes Null Student name Null
  └ customColumn No 1-50 words,No distinction between Chinese and English,More than 50 will automatically intercept 50 words User custom identity Do not return as empty,The field is not returned for empty
└ Student 2 account information object Yes Null You need to add student information objects Null
  └ uid Yes NULL student UID Register the user UID returned by the user interface
  └ name Yes Null Student name Null
  └ customColumn No 1-50 words,No distinction between Chinese and English,More than 50 will automatically intercept 50 words User custom identity Do not return as empty,The field is not returned for empty
└ ······ Yes Null You need to add student information objects Null
  └ uid Yes NULL student UID Register the user UID returned by the user interface
  └ name Yes Null Student name Null
  └ customColumn No 1-50 words,No distinction between Chinese and English,More than 50 will automatically intercept 50 words User custom identity Do not return as empty,The field is not returned for empty

Response Parameters

Key Type Sample Value Meaning
data array [] Returns an array of Data information
└ data Return information1 object Return message object
  └ errno number 1 Error code
  └ error string "Normal execution" Error list
└ data Return information2 object Return message object
  └ errno number 1 The error code
  └ error string "Normal execution" Error list
└ ······ object Return message object
  └ errno number ··· Error code
  └ error string ··· error list
error_info object Return message object
└ errno number 1 Error code
└ error string "Normal execution" Error list

Sample

  • HTTP Request
POST /partner/api/course.api.php?action=addClassStudentMultiple HTTP/1.1
Host: www.eeo.cn
Content-Type: application/x-www-form-urlencoded
Cache-Control: no-cache

SID=2339736&safeKey=a82c69dc799d6520e631f07f69ac6c96&timeStamp=1493726450&courseId=523689&classId=1419691&identity=1&studentJson=[{"uid":"1001001","name":"小丫","password":"123456","customColumn":123},{"uid":"1001002","name":"小白","password":"123456","customColumn":123}]
  • 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=442447 " \
        -d "classId=23456" \
        -d "identity=1" \
        -d 'studentJson = \
        [ \
              { \
                "uid":"1001011", \
              }, \
              { \
                "uid":"1001001", \
              } \
        ]' \
        "https://root_url/partner/api/course.api.php?action=addClassStudentMultiple"

Response Sample(The normal return json packet example)

{
  "data": [
    {
      "customColumn": "123",
      "errno": 1,
      "error": "程序正常执行"
    },
    {
      "customColumn": "123",
      "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.).
113 The mobile phone number has not been registered yet.
114 Server exception.
125 The student's mobile phone number is illegal.
129 Course teachers cannot be set as students.
131 Registration failed.
142 There is no information about the lesson in the course.
143 There is no information about this lesson.
144 There is no such course in your institution.
145 The lesson is finished.
155 Array data of students cannot be null.
157 The number of students in the lesson exceeds the limit.
158 Failed to add students to the lesson.
159 Only support to operate students.
164 The course auditing student already exists.
166 The student already exists in the lesson.
212 The lesson has been deleted.
228 There is no such student in your institution.
288 The mobile phone number is illegal.
329 The co-teachers in the lesson cannot be set as students in the same lesson.
332 Course teachers or co-teachers cannot be set as course students or course auditing students.
333 The course advisor cannot be set as a course student.
369 Do not support to operate this type of courses and lessons(public course).
400 The requested data is illegal.
466 The lesson was created in the ClassIn LMS and cannot be edited via API. Please edit the lesson in the ClassIn LMS.
886 The student's account has been deleted by the user.

results matching ""

    No results matching ""