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
}
]
}
Courses
Assign Course
Assign the course to users or groups
POST
/
courses
/
{courseId}
/
assignments
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
}
]
}
Assign a course to specific users and/or groups.
Path Parameters
integer
required
The unique identifier of the course
Request Headers
string
required
API Key. Go to your Konstantly site > Settings > API and copy the value from there.
Request Body
array
Array of user IDs to assign the course to
array
Array of group IDs to assign the course to
integer
Timestamp of date and time (UTC) when the course should be assigned
integer
Timestamp of date and time (UTC) of the deadline for course completion
Response
array
required
array
required
Error Responses
object
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
}
]
}
Was this page helpful?