Assign a course to specific users and/or groups.
Path Parameters
The unique identifier of the course
API Key. Go to your Konstantly site > Settings > API and copy the value from there.
Request Body
Array of user IDs to assign the course to
Array of group IDs to assign the course to
Timestamp of date and time (UTC) when the course should be assigned
Timestamp of date and time (UTC) of the deadline for course completion
Response
Users the course was successfully assigned toShow User object properties
Groups the course was successfully assigned toShow Group object properties
Number of users in the group
Number of courses assigned to the group
Error Responses
Returned when the course is not foundShow Error object properties
curl --request POST \
--url https://YOURSITE.konstant.ly/openapi/v1/courses/123/assignments \
--header 'X-API-KEY: 1qaz2wsx3edc4rfv1qaz2wsx3edc4rfv' \
--header 'Content-Type: application/json' \
--data '{
"users": [1, 2, 3],
"groups": [4, 5],
"assignAt": 1676937600,
"deadlineAt": 1677024000
}'
{
"users": [
{
"id": "1234567890",
"name": "John Doe",
"email": "john@example.com",
"role": {
"alias": "learner"
}
}
],
"groups": [
{
"id": 4,
"name": "Sales Team",
"usersCount": 10,
"coursesCount": 5
}
]
}