Creating an Enrollment
AVAILABLE WITH BUSINESS SUBSCRIPTION
Request: POST /enrollment
Notes:
- This method only allows you to enroll users in courses, learning tracks and standalone materials. You can't enroll a user in a training using this method.
- With this method, you can enroll a user in a course containing a training, but without selecting a session to attend. The user will be able to choose a session in their portal.
Permissions to Run the Request
The Account Owner, Account Administrators, Department Administrators, or custom roles.
Department Administrators, and users with a custom role can enroll in courses only learners belonging to the departments they manage and their sub-departments.
Request Headers
Authorization (required) | Access token. You can obtain a token by making a request. |
Parameter | Description |
---|---|
courseIds (required) | The IDs of the courses you want to assign. |
learnerIds (required) | The IDs of the learners you want to enroll in the courses. |
accessDate (optional) | The date and time when learners are supposed to start studying the course. If the start date and time aren't indicated, the current date and time will be auto-populated. |
dueDateType (required) | This parameter indicates whether the course has a due date or it isn't time-limited. Possible values of the parameter are unlimited, default, due_date, due_period. |
dueDate (required) | This parameter is required if dueDateType = due_date. |
duePeriod (required) | This parameter is required if dueDateType = due_period. It is measured in hours. |
lockAfterDueDate (optional) | This parameter indicates whether the course will be blocked after the due date. Possible values of the parameter are true or false. |
Header | Description |
Response Codes
201 | Created | New enrollments have been created. |
400 | Bad Request | A request error. |
401 | Unauthorized | An authorization error. |
403 | Permission Denied | The user doesn't have enough permissions to create enrollments. |
Code | Text | Description |
---|
Sample Request
POST /enrollment https/1.1
Host: api-learn.ispringlearn.com
Authorization: p-1sJDjmULL5DdpXPJTcbm4jVIaWVHvNmrjAxATRbNE
Content-Type:application/xml
<?xml version="1.0" encoding="UTF-8"?>
<request>
<courseIds>
<id>3fa85f64-5717-4562-b3fc-2c963f66afa6</id>
</courseIds>
<learnerIds>
<id>3fa85f64-5717-4562-b3fc-2c963f66afa6</id>
</learnerIds>
<accessDate>2019-09-26 10:30:00</accessDate>
<dueDateType>unlimited</dueDateType>
<dueDate>2019-09-26</dueDate>
<duePeriod>0</duePeriod>
</request>
Sample Response
https/1.1 201 Created