Thêm nhiều học sinh vào lớp học của khóa học (Transfer Student)

Mục lục

Lưu ý:  API này được sử dụng để thêm học sinh chuyển lớp (Transfer student). Học sinh chuyển lớp chỉ có thể vào Lớp được chỉ định chứ không phải là học sinh của Khóa học, không thể tham gia vào các lớp học khác của khóa học. Ngoài ra, học sinh chuyển lớp sẽ không thể tham gia vào phần Chat của khóa học hay tham gia các hoạt động trước vào sau giờ học như bài tập về nhà, lớp học ghi hình trước, checkin,v.v.


Để thêm nhiều học sinh trong một lớp, cần truyền các tham số ID, safeKey, timeStamp, course ID, class ID, tham số xác định vai trò học sinh hay người dự thính (1=học sinh), danh sách tài khoản học sinh, studentUID và tên học sinh.
Người dự thính không thể được thêm vào trong một lớp học.

Ghi chú: Đề xuất chỉ nên thêm 30 học sinh trong 1 lần gọi API

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 #

KeyBắt buộcYêu cầu thêmMô tảHướng dẫn
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
classIdBắt buộcClass ID
identityBắt buộcXác định vài trò của tài khoản (1=học sinh)
studentJsonBắt buộcYou need to add an account array
└ Student 1 account information objectBắt buộcYou need to add student information objects
  └ uidBắt buộcstudent UIDUID hệ thống trả về khi đăng ký tài khoản thành công
  └ nameBắt buộcStudent name
  └ customColumnKhông bắt buộcTối đa 50 ký tựUser custom identityNếu để trống thì dữ liệu sẽ trả về trống
└ Student 2 account information objectBắt buộcYou need to add student information objects
  └ uidBắt buộcstudent UIDRegister the user UID returned by the user interface
  └ nameBắt buộcStudent nameNull
  └ customColumnKhông bắt buộcTối đa 50 ký tựUser custom identityNếu để trống thì dữ liệu sẽ trả về trống
└ ······Bắt buộcYou need to add student information objects
  └ uidBắt buộcstudent UIDRegister the user UID returned by the user interface
  └ nameBắt buộcStudent name
  └ customColumnKhông bắt buộcTối đa 50 ký tựUser custom identityNếu để trống thì dữ liệu sẽ trả về trống

Response Parameters #

KeyĐịnh dạngPhản hồiÝ nghĩa
dataarray[]Returns an array of Data information
└ data Return information1object Return message object
  └ errnonumber1Error code
  └ errorstring“Normal execution”Error list
└ data Return information2object Return message object
  └ errnonumber1The error code
  └ errorstring“Normal execution”Error list
└ ······object Return message object
  └ errnonumber···Error code
  └ errorstring···error list
error_infoobject Return message object
└ errnonumber1Error code
└ errorstring“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 CodeMô tả
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)
113Số điện thoại chưa được đăng ký tài khoản ClassIn
114Lỗi server
125Số điện thoại của học sinh không hợp lệ
129Giáo viên của khóa học không thể được thiết lập làm học sinh
131Đăng ký thất bại
142Không có thông tin về lớp học trong khóa học này
143Không có thông tin về lớp học này
144Không có khóa học này trong trường
145Lớp học đã kết thúc
155Danh sách học sinh không thể để trống
157Số lượng học sinh trong lớp học đã vượt số lượng tối đa
158Thêm học sinh vào lớp học thất bại
159Chỉ hỗ trợ thao tác cho học sinh thuộc lớp học này
164Tài khoản này đã là người dự thính của khóa học này
166Học sinh đã tồn tại trong lớp học này
212Lớp học đã bị xóa
228Không có học sinh này trong danh sách học sinh của trường
288Số điện thoại không hợp lệ
329Trợ giảng của lớp học không thể được thêm làm học sinh của lớp
332Giáo viên của khóa học và trợ giảng không thể được thêm làm học sinh
333GVCN của khóa học không thể được thiết lập làm học sinh của khóa học
369Lớp học công khai không cho phép thao tác
400Dữ liệu được yêu cầu không hợp lệ
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
886Tài khoản của học sinh đã bị xóa