Thêm nhiều học sinh vào buổi 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 buổi học đượ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 buổi 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à, bài kiểm tra, checkin,v.v.


Để thêm nhiều học sinh trong một buổi, 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 buổi 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

Key Bắt buộc Yêu cầu thêm Mô tả Hướng dẫn
SID Bắt buộc ID của trườngXem dữ liệu này tại Trang quản lý classin.com trong mục API
safeKey Bắt buộc Fixed 32-bit all lowercase characters Khóa bảo mật xác thực trường học safeKey=MD5(SECRET+timeStamp)
timeStamp Bắt buộc Theo Unix Epoch timestamp & có hiệu lực trong vòng 20 phút Thờ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
courseId Bắt buộc Course ID
classId Bắt buộc Class ID
identity Bắt buộc Xác định vài trò của tài khoản (1=học sinh)
studentJson Bắt buộc You need to add an account array
└ Student 1 account information object Bắt buộc You need to add student information objects
  └ uid Bắt buộc student UID UID hệ thống trả về khi đăng ký tài khoản thành công
  └ name Bắt buộc Student name
  └ customColumn Không bắt buộc Tối đa 50 ký tự User custom identity Nếu để trống thì dữ liệu sẽ trả về trống
└ Student 2 account information object Bắt buộc You need to add student information objects
  └ uid Bắt buộc student UID Register the user UID returned by the user interface
  └ name Bắt buộc Student name Null
  └ customColumn Không bắt buộc Tối đa 50 ký tự User custom identity Nếu để trống thì dữ liệu sẽ trả về trống
└ ······ Bắt buộc You need to add student information objects
  └ uid Bắt buộc student UID Register the user UID returned by the user interface
  └ name Bắt buộc Student name
  └ customColumn Không bắt buộc Tối đa 50 ký tự User custom identity Nếu để trống thì dữ liệu sẽ trả về trống

Response Parameters

Key Định dạng Phản hồi Ý nghĩa
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 Mô tả
1 Thành công
100 Parameters sai định dạng hoặc không hoàn chỉnh
102 Không có quyền thao tác (Xác thực bảo mật thất bại)
113 Số điện thoại chưa được đăng ký tài khoản ClassIn
114 Lỗi server
125 Số điện thoại của học sinh không hợp lệ
129 Giá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
142 Không có thông tin về lớp học trong khóa học này
143 Không có thông tin về lớp học này
144 Không có khóa học này trong trường
145 Lớp học đã kết thúc
155 Danh sách học sinh không thể để trống
157 Số lượng học sinh trong lớp học đã vượt số lượng tối đa
158 Thêm học sinh vào lớp học thất bại
159 Chỉ hỗ trợ thao tác cho học sinh thuộc lớp học này
164 Tài khoản này đã là người dự thính của khóa học này
166 Học sinh đã tồn tại trong lớp học này
212 Lớp học đã bị xóa
228 Không có học sinh này trong danh sách học sinh của trường
288 Số điện thoại không hợp lệ
329 Trợ giảng của lớp học không thể được thêm làm học sinh của lớp
332 Giáo viên của khóa học và trợ giảng không thể được thêm làm học sinh
333 GVCN 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
369 Lớp học công khai không cho phép thao tác
400 Dữ liệu được yêu cầu không hợp lệ
466 Lớ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
886 Tài khoản của học sinh đã bị xóa