MOOCit Docs
Rechercher…
Bulk enroll
post
https://your-platform-url.com
/api/bulk_enroll/v1/bulk_enroll/
Bulk enroll

Bulk enrollment

Inscrire un ou plusieurs utilisateurs dans un ou plusieurs cours.

Request example

1
POST /api/bulk_enroll/v1/bulk_enroll/ {
2
"auto_enroll": true,
3
"email_students": true,
4
"action": "enroll",
5
"courses": "course-v1:edX+Demo+123,course-v1:edX+Demo2+456",
6
"cohorts": "cohortA,cohortA",
8
}
Copied!

POST Parameters

Key
Comments
auto_enroll
When set to true, students will be enrolled as soon as they register.
email_students
When set to true, students will be sent email notifications upon enrollment.
action
Can either be set to "enroll" or "unenroll". This determines the behavior
cohorts
Optional. If provided, the number of items in the list should be equal to the number of courses. first cohort coressponds with the first course and so on. The learners will be added to the corresponding cohort.

Response Values

If the supplied course data is valid and the enrollments were successful, an HTTP 200 "OK" response is returned. The HTTP 200 response body contains a list of response data for each enrollment. If a cohorts list is provided, additional 'cohort' keys will be added to the 'before' and 'after' states.
1
{
2
"action": "unenroll",
3
"courses": {
4
"course-v1:edX+DemoX+Demo_Course": {
5
"action": "unenroll",
6
"results": [
7
{
8
"identifier": "[email protected]",
9
"after": {
10
"enrollment": true,
11
"allowed": false,
12
"user": true,
13
"auto_enroll": false
14
},
15
"before": {
16
"enrollment": false,
17
"allowed": false,
18
"user": true,
19
"auto_enroll": false
20
}
21
}
22
],
23
"auto_enroll": true
24
}
25
},
26
"email_students": false,
27
"auto_enroll": true
28
}
Copied!
Dernière mise à jour 8mo ago