Learn365 allows enrolling of users in courses and training plans via the Learn365 Admin Center functionality as well as using Learn365 API. This article describes the enrollment in training plan via the Learn365 API.
To enroll a user in a training plan, follow the steps:
1. Navigate to https:/api.365.systems/ and authorize with the relevant API key. You can find more about the authorization process here.
NOTE
To enroll a user in a training plan the same API endpoint is used as for enrollment in e-Learning and Instructor-Led Training courses.
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, two fields will be displayed. You will need to fill in the required parameters:
- key:Id where you need to enter the ID of the training plan you want to enroll a user or a group in, and
- userLoginName under the Edit Value, where you need to replace the string in the "userLoginName": "string" with the login name of the user you want to enroll in a course.
Please delete the "courseSessionId": "string", "courseSessionIds": ["guid"], part from the request body when enrolling a user in a training plan for the request to run successfully.
An example of an API request of enrolling a user in a training plan:
{ "userLoginName": "i:0#.f|membership|kayb@lms365preview.onmicrosoft.com", "ignoreMaxAttendees": true, "ignoreEnrollmentFlow": true }
4. When you are ready, select the Execute button 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 details of the enrollment in the request response. The user will be enrolled in the training plan and in all of the courses of this training plan which can be checked via Learn365 Admin Center > select the relevant training plan > Manage People.
NOTE
The response will contain the following important information:
- "Roles" - Differs depending on whether the user has a course admin role during enrolling in the training plan via API or not.
If a user has no admin role assigned in a training plan - the Learner role only will be displayed in the response for this user. If a user assigned as a training plan admin is enrolled in this training plan via API, the API response will display two roles for this user - Learner (learner) and Teacher (admin).
- "RegistrationStatus" - Differs depending on the enrollment flow configured for the training plan. It can be Active for training plans with the Automatic Approval enrollment flow or Awaiting for training plans with the Administrator or Line Manager Approval enrollment flows. The status can be changed from Awaiting to Active via the Learn365 Admin Center functionally, or with the help of the POST/odata/v2/Enrollments({Id})/Approve or POST/odata/v2/Enrollments({Id})/Reject API endpoints respectively.
Comments
Article is closed for comments.