Enrolling users in a specific course session via API

LMS365 allows to enroll users in a specific session of a course of the 'Enroll user into a single course session' enrollment type via LMS365 Admin Center functionality or by using LMS365 API endpoints. 

There are two approaches to enroll a user in a session of a course of the 'Enroll user into a single course session' enrollment type, one is dedicated to a simple enrollment in a course without selecting a session and the other allows to set various additional parameters during the enrollment.

This article describes the second approach and what APIs to use and what steps to perform.

 

To enroll a user in a specific session of an Instructor-Led Training of the Enroll user into a single course session enrollment type, do the following:

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 list of LMS365 Cloud API sections find the Enrollments section, expand it, find the POST method /odata/v2/Enrollments endpoint with the Creates an Enrollment. description and click Try it out

 

1229.png

 

3. After you click Try it out, in the Edit Value field you need to fill in the required parameters and configure others if needed or delete them:

  • "CourseId": "guid", where guid should be replaced with the ID of the relevant course.
  • "UserId": "guid", where guid should be replaced with the ID of the user you want to enroll in a course session.
  • "UserLoginName": "string", where string should be replaced with the login name of the user you want to enroll in a course session.
  • "RegistrationStatus": "integer" where integer should be replaced with 0.

For example, the request may look like this:

{
  "CourseId": "7bb988b8-140a-4ee5-9141-5863868e719f",
  "UserId": "903e8297-0c1f-4d4d-85ee-12aa2530a0b7",
  "UserLoginName": "i:0#.f|membership|AdeleV@lms365preview.onmicrosoft.com",
  "RegistrationStatus": "0"
  }

 

When ready, select the blue Execute button to run the request.

 

4. Go to the Responses block to check the results:

  • Number 2xx (for example, 200) under Code shows that the request worked correctly.
  • At this step the user will be enrolled in the course, but not in any of its sessions. In the Response body field you will see the enrollment ID after "value", please copy it for further steps to finish enrolling a user in a specific course session.​
    You can download this data ​in a JSON file format via the Download button.

 

1230.png

 

5. Go to the Enrollments section, find the GET /odata/v2/Enrollments({Id})/AssociateWithCourseSession  with the Associates enrollment with course session description, expand it and click Try it out.

 

2022-06-27_18_04_50-LMS365_API.png

 

Fill in the required parameters here:

  • key:Id where you need to insert the enrollment ID from the response above (see step 4). 

TIP   

If the user has already been enrolled in the relevant course, but not in the selected course session, you can find the user's enrollment ID to use in this step via the command GET​ /odata​/v2​/Enrollments with the Returns the list of current user's active Enrollments description. For the $filter query option parameter enter CourseId eq Id, where Id should be replaced with the ID of the relevant course. Select 'Execute' to run the request.

1233.png

Go to the Response body to see the results of the request. The value next to the "Id" parameter is the the enrollment ID which you can copy to for the further enrolling of the user in the required course session.

2022-06-28_11_59_39-LMS365_API.png

2022-06-27_18_24_44-LMS365_API.png

 

When ready, select the blue Execute button.

 

6. Go to the Responses block to check the results:

  • Number 2xx (for example, 200) under Code shows that the request worked correctly.

    2022-06-28_09_56_15-LMS365_API.png

  • At this step the user will be successfully enrolled in the selected course session. To ensure this, go to the LMS365 Admin Center > select the relevant course > Manage People > check the Name and Session columns to see if the required user is enrolled in the relevant course session. 

    2022-06-28_09_41_36-Training_Management.png

  • You can download this data ​in a JSON file format via the Download button.

 

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

Comments

Article is closed for comments.