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

NameTypeExampleRequiredDescription
Authorizationstringaccess_tokenYESToken of authentication. Get from Authentication API
Acceptstringapplication/jsonYESDefines the message format that is expected by the client
Content-Typestringapplication/jsonYESDefines the message format of the request body that is sent by the client

Parameter

NameTypeRequiredLocationDescription
courseSerialstringYESpathSerial of course
userSerials[]stringYESbodySerials of user. Required without employeeIDs
employeeIDs[]stringYESbodyEmployee IDs of user. Required without userSerials
isMandatoryboolYESbodySet assignment as Mandatory or Not
dueDatedatetime (Format: ISO8601)OPTIONALbodyDate of maximum user can learn the course
assignedDatedatetime (Format: ISO8601)OPTIONALbodyDate user will be assign the course, null if immediately
maxPostTestAttemptsintegerOPTIONALbodyMaximum attempt post test of assignment. 0 is equal unlimited Post-test attempt
formSetting[]FormSettingYESbodyList of FormSetting, Set empty array if doesn’t have FormSetting

FormSetting

NameTypeRequiredLocationDescription
formSerialstringYESbodySerial of FormSetting
lockByenumYESbodyenum(“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.