Create Non-Classroom Acitivity
Note:
- You can create drafts for these activities(except for classroom):
Assignment;Test; Recorded Lesson; Resources; Discussion; Answer Sheet; Recurring Assignment ;
URL
https://root_url/lms/activity/createActivityNoClass
HTTP Request Methods
Request Data
Key |
Required |
Type |
Description |
X-EEO-SIGN |
Yes |
string |
Signature; see the rules here |
X-EEO-UID |
Yes |
string |
Institution's SID |
X-EEO-TS |
Yes |
string |
Timestamp |
Body
key |
Required |
Type |
Description |
Rules Description |
courseId |
Yes |
integer |
Class (Course) ID |
|
unitId |
Yes |
integer |
Unit ID |
|
activityType |
Yes |
integer |
Type |
2=Assignment;3=Test;4=Recorded Lesson;5=Resources;6=Discussion;7=Answer Sheet;8=Recurring Assignment |
name |
Yes |
String |
activity name |
Length must not exceed 50 characters. |
teacherUid |
Yes |
integer |
teacher ID |
|
startTime |
No |
integer |
Start time of the activity |
Must be a Unix Epoch timestamp (in seconds) within the next 3 years |
endTime |
Yes |
integer |
End time of the activity |
Must be a Unix Epoch timestamp (in seconds) |
响应参数
Key |
Type |
Sample Value |
Description |
code |
integer |
1 |
error code |
msg |
string |
|
error msg |
data |
array |
[] |
returned data |
└ |
object |
|
object |
└ name |
integer |
"it's a draft" |
Activity name |
└ activityId |
integer |
26019953 |
Activity ID |
示例
POST /lms/activity/createActivityNoClass HTTP/1.1
root_url
37471286c6cfb95c4afb899396b884e2
409864
1722937773
application/json
165
{
"courseId": 414193,
"unitId":22360790,
"activityType":2,
"name": "draft for test",
"teacherUid":1006368,
"startTime":1724134581,
"endTime":1724138181
}
curl -X POST \
-H 'Host: root_url' \
-H 'X-EEO-SIGN: 37471286c6cfb95c4afb899396b884e2' \
-H 'X-EEO-UID: 409864' \
-H 'X-EEO-TS: 1722937773' \
-H 'Content-Type: application/json' \
-d '{"courseId": 414193, "unitId":22360790,"activityType":2, "name": "draft of test", "teacherUid":1006368, "startTime":1724134581,"endTime":1724138181}' \
'https://root_url/lms/activity/createActivityNoClass'
响应示例(正常时返回的 json
数据包示例)
{
"code": 1,
"msg": "程序正常执行",
"data": {
"name": "draft of test",
"unitId": 26020895
}
}
Error Code Descriptions
Error Code |
Descriptions |
147 |
No information for this class |
40020 |
unit not exist |
40031 |
Unit activity count exceeded |
21601030 |
Missing required parameters |
101001001 |
Parameter error |
101002005 |
Signature exception |
101002006 |
Timestamp expired |
101002008 |
imestamp does not exist |
121601020 |
Business parameter error |
121601021 |
Course does not belong to the current institution |
121601022 |
Course is not a standard course |
121601023 |
Course has expired |