Enroll users in a course via API

Users can be enrolled in a course via the Learn365 Admin Center functionality and the LMS365 (Learn365) API. This article describes what LMS365 (Learn365) API endpoints to use when enrolling users in courses.

 

To enroll a user in an LMS365 (Learn365) 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 here.

 

2. In the Courses section, select the POST /odata/v2/Courses({Id})/Enroll endpoint and select Try it out.

 

 

3. After you select Try it out, 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. Delete the courseSessionId parameter from the request body. 

  • courseSessionIds, a required parameter only if you want to enroll a user in a course of the single- or multiple- enrollment type and register them for session groups or standalone sessions of the course. Find more details about how to get the ID of a standalone session or session group here

    For a course of the single-enrollment type, replace guid with the ID of the single session group or standalone session which you want to register a user for.
    For a course of the multiple-enrollment type, replace guid with the ID of each of the session groups or standalone sessions which you want to register a user for. IDs of session groups and standalone sessions should be separated with a comma. 

    If the courseSessionIds parameter isn't specified for a course of the single- or multiple-enrollment type, the user will be enrolled in the course itself without being registered for any of its session groups or standalone sessions and they'll receive an email notification asking them to select and register for session groups or standalone sessions to finish the enrollment.

    The courseSessionIds parameter should be omitted when enrolling a user in a course of the all-enrollment type, otherwise the request will fail. However, you can use this parameter to register a user for specific session groups and standalone sessions of an all-enrollment type course by specifying the ID of particular session groups and standalone sessions of this course. 

  • ignoreMaxAttendees, an optional parameter for a course of the all-enrollment type, 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. Entering false makes the request fail if the maximum attendees limit of the course is reached. Courses of the single- and multiple-enrollment types have the maximum attendees set individually for each session group and standalone session and this should be configured using the ignoreSessionRequirements parameter.

  • 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 gives 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 a course of the all-enrollment type, 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 makes the request fail if the course enrollment deadline has been reached. Courses of the single- or multiple-enrollment type have enrollment deadlines set individually for each session group and standalone session and this should be configured using the ignoreSessionRequirements parameter.
  • ignoreSessionRequirements, an optional parameter. Replace boolean with true to enroll a user in a course of the single- or multiple-enrollment type, regardless of the requirements set individually for a session group and standalone session (maximum attendees, enrollment deadline). Entering false makes the request fail if the request body doesn't meet the requirements of the session group and standalone session in question.

Here is an example of a request to register a user for two sessions of a course of the multiple-enrollment type:

 

 

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 can see the results of the request - the user's enrollment and registrations are displayed. Also, in the RegistrationDate line, you can find the date and time of the user's enrollment. The user or group are enrolled in the course and receive the corresponding notifications. 
    User enrollments can be checked in the Learn365 Admin Center > Training Management > select the relevant course > the People section.

Group_21__17_.png

 

Was this article helpful?
2 out of 2 found this helpful

Comments

Article is closed for comments.