API dùng để tạo phân nhóm học tập cho Khóa học, thiết lập số thành viên trong nhóm và thay đổi thành viên giữa các nhóm.
To create a group plan for the course, you can set the group numbers and switch members to each group. The group plan will be applied to the classroom grouping tool inside the virtual classroom.
URL
https://root_url/partner/api/course.api.php?action=addCourseGroup
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ường | Xem 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 | |
groupList | Bắt buộc | json string | — | [ [{ “studentUid”: 1000152,”isLeader”: 1}, {“studentUid”: 1000109,”isLeader”: 0}],[{“studentUid”: 1000101,”isLeader”: 1}, {“studentUid”: 1000100,”isLeader”: 0}]] |
groupName | Bắt buộc | Cho phép hiển thị tối đa 20 ký tự | Tên của phân nhóm | — |
Response Data #
Key | Type | Sample Value | Meaning |
---|---|---|---|
error_info | object | Return message object | |
└ errno | number | 1 | Error code |
└ error | string | “Program normal execution” | Error list |
data | number | 147667 | group ID |
Sample #
- HTTP Request
POST /partner/api/course.api.php?action=addCourseGroup HTTP/1.1
Host: www.eeo.cn
Content-Type: application/x-www-form-urlencoded
Cache-Control: no-cache
SID=1234567&safeKey=5458edceccc78c6698de624e94364285&timeStamp=1493026245&courseId=176465&groupName=课程分组&groupList= [[{"studentUid": 1000152, "isLeader": 1 }, { "studentUid": 1000109, "isLeader": 0}],[{"studentUid": 1000101,"isLeader": 1}, {"studentUid": 1000100,"isLeader": 0}]]
- Shell cURL analog request instruction
curl -H "Content-Type: application/x-www-form-urlencoded" -X "POST" \
-d "SID=123456" \
-d "safeKey=b8fa5232411a0870ccd1f51c2146fdc9" \
-d "timeStamp=1637133326" \
-d "courseId=176465" \
-d "groupName=课程分组" \
-d 'groupList= [[{"studentUid": 1000152, "isLeader": 1 }, { "studentUid": 1000109, "isLeader": 0}],[{"studentUid": 1000101,"isLeader": 1}, {"studentUid": 1000100,"isLeader": 0}]]'\
"https://root_url/partner/api/course.api.php?action=addCourseGroup"
Response Sample(The normal return json
packet example) #
{
"error_info": {
"errno": 1,
"error": "程序正常执行"
},
"data": 147667 //groupId
}
Notes #
Description of groupList parameter
[
[{
"studentUid": 1000152,
"isLeader": 1
},
{"studentUid": 1000109,
"isLeader": 0
}],
[{
"studentUid": 1000101,
"isLeader": 1
},
{"studentUid": 1000100,
"isLeader": 0
}]
]
1. Paramter of studentUid and isLeader are required, there should be a leader for each team. (isLeader indicates the team leader. 1=Yes 0=No)
2. Team members can not be duplicated
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) |
104 | Thao tác không thành công (lỗi không xác định) |
890 | Thiết lập phân nhóm thất bại |
892 | Thao tác không thành công vì đã tồn tại phân nhóm |
895 | Thao tác không thành công, UID trưởng nhóm sai |
896 | Thao tác thất bại, học sinh không tồn tại trong trường |
897 | Thao tác thất bại. Tất cả học sinh đều chưa được thêm vào khóa học |
898 | Thao tác thành công. Một số studentUID chưa chính xác |