Create Course Group
Course grouping:
To create a group plan for the course, you can set the group numbers and switch members to each group. Only one group plan can be set under each course. 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 | 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 | Timestamp used by safeKey | Unix Epoch timeStamp is the number of seconds passed by 00:00 (world standard time) on January 1, 1970 |
courseId | Yes | course ID | ||
groupList | Yes | json string | Please see the notes part | [ [{ "studentUid": 1000152,"isLeader": 1}, {"studentUid": 1000109,"isLeader": 0}],[{"studentUid": 1000101,"isLeader": 1}, {"studentUid": 1000100,"isLeader": 0}]] |
groupName | Yes | 1-20 Characters , the string will be truncated to 20 characters | name of the group | no |
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 | description |
---|---|
1 | Successful execution. |
100 | Incomplete or incorrect parameters. |
102 | No permission(Security verification failed.). |
104 | Operation failure(Unknown error). |
890 | Failed to set the group. |
892 | Operation failed as there's already a group. |
895 | Operation failed. Leader UID error. |
896 | Operation failed. All students do not belong to your institution. |
897 | Operation failed. All students have not attended the course yet. |
898 | Group setting succeeded. Some students' UIDs are incorrect. |