Thêm học sinh/người dự thính vào lớp học của khóa học

Mục lục

Add student / listener (multiple) under the course, need SID, safekey, timestamp, the course ID, the identification of the student or auditor (1 for the student, 2 for the listener), and the array of student or audience accounts to be added. The array includes the account number and account name of each account, and the student / Auditor uid. Return the details of each account added. The user can pass the custom field, and the interface will return the parameter as it is. If it is not passed, it will not be returned. Students added under the course can attend all the classes under the course. Note: the maximum number of spectators can be added by default to 20.

URL #

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

HTTP Request Methods #

  • POST

Coding Format #

  • UTF-8

Request Data #

KeyRequiredMore RestrictionsInstructionsDescription
SIDYesNullSchool IDIt is available through the eeo.cn application
safeKeyYesFixed 32-bit all lowercase charactersSchool authentication security keysafeKey=MD5(SECRET+timeStamp)
timeStampYesNullImestamp used by safeKeyUnix Epoch timeStamp is the number of seconds passed by 00:00 (world standard time) on January 1, 1970
courseIdYesNullCourse IDNull
identityYesNullStudent and audit identification(1 is student,2 is attend)Null
studentJsonYesA maximum of 20 people can be added to the auditAn array of accounts to be addedNull
└ Student 1 account informationYesNullNeed to add student account informationNull
  └ nameYesNullStudent nameNull
  └ customColumnNo1-50 words,No distinction between Chinese and English,More than 50 will automatically intercept 50 wordsUser custom identityDo not return as empty,The field is not returned for empty
  └ uidNoNullStudents UIDRegister the user UID returned by the user interface
└ ······NoNullNeed to add student account informationNull
  └ nameYesNullStudent nameNull
  └ customColumnNo1-50 words,No distinction between Chinese and English,More than 50 will automatically intercept 50 wordsUser custom identityDo not return as empty,The field is not returned for empty
  └ uidNoNullStudents UIDRegister the user UID returned by the user interface

Response data #

KeyTypeSample ValueMeaning
dataarray[]Returns an array of data information
└ data Return message 1objectReturn information object
  └ customColumnstring123User – defined identity
  └ errnonumber1The error code
  └ errorstring“程序正常执行”错误详Error details情
└ data返回信息2objectReturn information object
  └ customColumnstring123User – defined identity
  └ errnonumber1The error code
  └ errorstring“程序正常执行”Error details
└ ······objectReturn information object
  └ customColumnstring123User – defined identity
  └ errnonumber···The error code
  └ errorstring···Error details
error_infoobjectReturn information object
└ errnonumber1The error code
└ errorstring“Routine execution”Error details

Sample #

  • HTTP Request
POST /partner/api/course.api.php?action=addCourseStudentMultiple 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=490583&identity=1&studentJson=[{"uid":"1001001","name":"Mary","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 "identity=1" \
        -d 'studentJson=[{"uid":"1001001","name":"学生一"},{"uid":"1002001","name":"学生二"}]' \
        "https://api.eeo.cn/partner/api/course.api.php?action=addCourseStudentMultiple"
    

Response Sample (normal return json packet sample) #

{
  "data": [
    {
      "customColumn": "123",
      "errno": 1,
      "error": "程序正常执行"
    }
  ],
  "error_info": {
    "errno": 1,
    "error": "程序正常执行"
  }
}

Error Code Description #

Error CodeDescription
1Successful execution.
100Incomplete or incorrect parameters.
102No permission(Security verification failed.).
104Operation failure(Unknown error).
113The mobile phone number has not been registered yet.
114Server exception.
125The student’s mobile phone number is illegal.
129Course teachers cannot be set as students.
130Exceeds the number of students that can be added.
131Registration failed.
133Already exists (The error will be reported when you pass repeated accounts.).
134Illegal mobile phone number.
144There is no such course in your institution.
147There is no information about the course.
149The course has been deleted.
153The course is expired and cannot be edited.
155Array data cannot be null.
163The course student already exists.
164The course auditing student already exists.
174Teachers cannot be set as auditing students.
228There is no such student in your institution.
288The mobile phone number is illegal.
332Course teachers or co-teachers cannot be set as course students or course auditing students.
333The course advisor cannot be set as a course student.
369Do not support to operate this type of courses and lessons(public course).
400The requested data is illegal.
841Successfully added students to the course. Failed to synchronize class nicknames.
886The student’s account has been deleted by the user.
887The auditing student’s account has been deleted by the user.