Users can be enrolled in a course via the LMS365 Admin Center functionality and the LMS365 API. This article describes what LMS365 API endpoints to use when enrolling users in courses.
To enroll a user in an LMS365 course via API endpoints:
1. Navigate to https:/api.365.systems/ and authorize with the relevant API key. You can find more about the authorization process in this article.
2. In the list of LMS365 Cloud API sections, find the Courses section, expand it, find the POST method /odata/v2/Courses({Id})/Enroll with the Enrolls user or group into a Course description, and then select Try it out in the top right-hand corner.
3. After you select Try it out, two fields will be displayed. You need to complete the fields, paying particular attention to the required parameters:
- key:Id, a required parameter. Enter the ID of the course you want to enroll a user or a group in.
- userLoginName, a required parameter. Replace string with the login name of the user you want to enroll in the course.
- courseSessionId parameter is deprecated and shouldn't be used for the request. Delete the courseSessionId parameter from the request body.
- courseSessionIds, a required parameter only if you want to enroll a user and register them in one or more sessions of a single- or multiple-sessions course, respectively. Find more information about how to get the ID of a session in this article.
For a single-session course, replace guid with the ID of the single session for which you want to register a user. For a multiple-sessions course, replace guid with the ID of each of the sessions for which you want to register a user. Session IDs should be separated with a comma.
If the courseSessionIds parameter isn't specified for a single- or multiple-sessions course, the user will be enrolled in the course itself without being registered for any of its sessions and they'll receive an email notification asking them to select and register for sessions to finish the enrollment.
The courseSessionIds parameter should be omitted when enrolling a user in an all-sessions course, otherwise the request will fail. However, you can use this parameter to register a user in sessions of an all-sessions course by specifying the ID of particular sessions of this course. - ignoreMaxAttendees, an optional parameter for an all-sessions course, only if the course has no maximum attendees set. Replace boolean with true to enroll a user in a course, regardless of the maximum attendees limit of the course. Enter false will make the request fail if the maximum attendees limit of the course is reached. Courses that have a single- or multiple-sessions enrollment type have the maximum attendees set individually for each session and this should be configured using ignoreSessionRequirements (below).
- ignoreEnrollmentFlow, an optional parameter only if the course has the Automatic Approval enrollment flow set. Replace boolean with true to enroll a user in a course regardless of the course enrollment flow. Entering false will give the user's enrollment the awaiting approval status if the course has Administrator Approval or Line Manager Approval enrollment flow.
- ignoreEnrollmentDeadline, an optional parameter for an all-sessions course, only if the course has no enrollment deadline set. Replace boolean with true to enroll a user in a course regardless of whether the course enrollment deadline has been reached. Entering false will make the request fail if the course enrollment deadline has been reached. Courses of a single- or multiple-sessions enrollment type have enrollment deadlines set individually for each session and this should be configured using ignoreSessionRequirements (below).
- ignoreSessionRequirements, an optional parameter. Replace boolean with true to enroll a user in a single- or multiple-sessions course, regardless of the requirements set individually for a session (maximum attendees, enrollment deadline). Entering false will make the request fail if the request body doesn't meet the session requirements.
Here is an example of a request to register a user for two sessions of a multiple-sessions course:
TIP
There is another approach you can use to enroll a user in a single- or multiple-sessions course and register for sessions that allows you to set additional parameters during the enrollment process. This approach is described in this article.
4. When ready, select Execute to run the request.
5. Go to the Responses block to check the results:
- Number 2xx (for example, 201) under Code shows that the request worked correctly.
- In the Response body field, you will see the results of the request - the user's enrollment and registrations will be displayed. Also, in the RegistrationDate line, you can find the date and time of the user's enrollment. The user or group will be enrolled in the course and will receive the corresponding notifications.
User enrollments can be checked in the LMS365 Admin Center > Training Management > select the relevant course > the People section.
Comments
Article is closed for comments.