Assign Online Course
This end point is use for create assignment online course
[POST] /ruangkerja/courses/online/:courseSerial/assignment
Information
This API is a function for assign user to course online in your organization.
Headers
Name | Type | Example | Required | Description |
---|---|---|---|---|
Authorization | string | access_token | YES | Token of authentication. Get from Authentication API |
Accept | string | application/json | YES | Defines the message format that is expected by the client |
Content-Type | string | application/json | YES | Defines the message format of the request body that is sent by the client |
Parameter
Name | Type | Required | Location | Description |
---|---|---|---|---|
courseSerial | string | YES | path | Serial of course |
userSerials | []string | YES | body | Serials of user. Required without employeeIDs |
employeeIDs | []string | YES | body | Employee IDs of user. Required without userSerials |
isMandatory | bool | YES | body | Set assignment as Mandatory or Not |
dueDate | datetime (Format: ISO8601) | OPTIONAL | body | Date of maximum user can learn the course |
assignedDate | datetime (Format: ISO8601) | OPTIONAL | body | Date user will be assign the course, null if immediately |
maxPostTestAttempts | integer | OPTIONAL | body | Maximum attempt post test of assignment. 0 is equal unlimited Post-test attempt |
formSetting | []FormSetting | YES | body | List of FormSetting, Set empty array if doesn’t have FormSetting |
FormSetting
Name | Type | Required | Location | Description |
---|---|---|---|---|
formSerial | string | YES | body | Serial of FormSetting |
lockBy | enum | YES | body | enum(“open”,“manual”) |
Example cURL Request Course With Feedback Form
curl --location --request POST 'https://api.ruangkerja.id/ruangkerja/courses/COURSE-EXAMPLE1/assignment' \
--header 'Authorization: access_token' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
"userSerials": ["JOHNILXV3QAJJEL3"],
"employeeIDs": [],
"isMandatory": true,
"dueDate": null,
"assignedDate": null,
"maxPostTestAttempts": 99,
"formSetting": [
{
"formSerial": "FOM-QKNLFNL1",
"lockBy": "open"
},
{
"formSerial": "FOM-ZLEWOODZ",
"lockBy": "manual"
}
]
}'
Example cURL Request Course With Without Feedback Form
curl --location --request POST 'https://api.ruangkerja.id/ruangkerja/courses/COURSE-EXAMPLE1/assignment' \
--header 'Authorization: access_token' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
"userSerials": ["JOHNILXV3QAJJEL3"],
"employeeIDs": [],
"isMandatory": true,
"dueDate": null,
"assignedDate": null,
"maxPostTestAttempts": 99,
"formSetting": []
}'
Example Success Response
{
"status": "success",
"message": "Success"
}
Example Failed Response
{
"errorCode": 123,
"message": "rpc error: code = PermissionDenied desc = Token is not valid",
"detail": "rpc error: code = PermissionDenied desc = Token is not valid"
}
See also: Error Dictionary.