Skip to main content

Update Enrolment

Overview

An enrolment can be one of the following types:

  1. Workshop (type w)
  2. Class (type p)
  3. Unit (type s)
  4. E-Learning (type el)

A student’s enrolment in a class may also include one or multiple unit enrolments.

Unit Enrolment

There is no API to update multiple unit enrolments with a single request. To update the unit competency outcomes for multiple units in a student’s enrolment, you will need to make individual API calls for each unit.

Retrieve Unit Enrolments

To get all unit enrolments for a student's class enrolment, make a GET request to /course/enrolments with the following parameters:

  • contactId: The student's contact ID.
  • instanceId: The class instance ID.
  • type: Set to 'p' for class enrolment.

The API response will include an array of activities. All activities with the type s are the unit enrolments. You will require the value of the ID property for the PUT request.

Update Unit Enrolment

For each unit enrolment, make a PUT request to /course/enrolment with the following parameters:

  • contactId: The student's contact ID.
  • instanceId: The unit ID (this ID does not change between classes and is the underlying unit ID)
  • programInstanceId: The class ID.
  • type: s for unit enrolment.
  • competent: The numerical outcome code as specified in the documentation.

In order to modify unit start and end dates, provide the following paramaters with values in format of (YYYY-MM-DD):

  • activityStartDate: The unit's start date.
  • activityEndDate: The unit's end date.

Learning Plan Module Enrolment

When updating a student's module enrolments in a Learning Plan, you may also need to update their unit enrolments (see above for more information).

Retrieve module enrolment details

To retrieve module enrolment details, generate a Learning Plan Module Enrolments report by making a POST request to /report/run with the below parameters. Within selectedFilterFields value, replace the placeholder values for contactid and classid (also known as instanceId) with appropriate values for your data.

  • reportReference: learningModuleEnrolments
  • selectedViewFields:
    contacts.contactid,contacts.fullname,learningmoduleenrolments.moduleenrolmentid,learningmoduleenrolments.modulename,learningmoduleenrolments.status,learningmoduleenrolments.startdate,learningmoduleenrolments.enddate,learningmoduleenrolments.commencementdate,learningmoduleenrolments.completiondate,classes.classid,classes.classdescriptor,enrolments.enrolid,enrolments.dateenrolled,enrolments.learningplanname
  • selectedFilterFields:
[
{"name":"learningmoduleenrolments.statusid","value":"1,2","operator":"text IN"},
{"name":"contacts.contactid","value":"12345678","operator":"IN"},
{"name":"classes.classid","value":"1234567","operator":"IN"}
]

The example filters above include module statuses Enrolled (1) and In Progress (2). To determine the integer value of other possible statuses, make a GET request to /report/field?fieldReference=learningmoduleenrolments.statusid.

To view other possible view fields, make a GET request to /report/fields?reportReference=learningModuleEnrolments.

Update module enrolment

It is possible to update the start date, end date, and override status for a module enrolment. Each of these fields are optional in the request.

For each module enrolment to update, make a PUT request to /v2/learningPlan/modules/enrolments with the following paramaters:

  • contactId: The student's contact ID.
  • enrolId: The enrolId value from the report results.
  • classId: The class ID (also known as instanceId)
  • moduleEnrolmentId: The moduleEnrolmentId value from the report results.
  • accessOverride:
    • true (unlocked);
    • false (locked); or
    • no value/empty string (clear override)
  • startDate: The module's start date (format YYYY-MM-DD)
  • endDate: The module's end date (format YYYY-MM-DD)
  • useCache: false (to return the current module enrolment after this change)