Classrooms
Enroll User in a Course
Enrolls a user in a course in a classroom.
If the course is paid, user must have an active license.
User must be a member of the classroom.
PUT
/api/classrooms/{classroomHandle}/courses/{courseHandle}/enrolled
Authorization*
curl --request PUT \
--url https://codecombat.com/api/classrooms/{classroomHandle}/courses/{courseHandle}/enrolled \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '{
"userId": "<userid>"
}'
{
"_id": "string",
"courses": [
{
"_id": "string",
"enrolled": [
"string"
],
"instance_id": "string",
"levels": [
"object"
]
}
],
"description": "string",
"members": [
"string"
],
"name": "string",
"ownerID": "string"
}
Authorizations
Authenticationheaderrequired
string
Basic authentication header of the form Basic <encoded-value>
, where <encoded-value>
is the base64-encoded string username:password
.
Path Parameters
classroomHandlerequired
string
The classroom's _id
.
courseHandlerequired
string
The course's _id
.
Query Parameters
retMemberLimit
number | null
limit the return number of members for the classroom, the default value is 1000
Body
application/json
userIdrequired
string
Response
200 - application/json
_id
string | null
courses
object[] | null
description
string | null
members
string[] | null
name
string | null
ownerID
string | null
curl --request PUT \
--url https://codecombat.com/api/classrooms/{classroomHandle}/courses/{courseHandle}/enrolled \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '{
"userId": "<userid>"
}'
{
"_id": "string",
"courses": [
{
"_id": "string",
"enrolled": [
"string"
],
"instance_id": "string",
"levels": [
"object"
]
}
],
"description": "string",
"members": [
"string"
],
"name": "string",
"ownerID": "string"
}