Skip to content
English
  • There are no suggestions because the search field is empty.

HR Learn: API v2 - Course Enrollment API

The Course Enrollment API performs actions related to course enrollments in the HR Learn LMS.

The Course Enrollment API performs actions related to course enrollments in the HR Learn LMS. The following methods are available via this API:

Enroll a user in course(s)

HTTP Action

POST

Base URL

https://[Your HR Learn LMS Portal URL]

Endpoint URL

/api/courseenrollment/v2/enroll

Request Parameters

Parameter Data Type Description
IdUser (required) integer

The id of the user to enroll in course(s).

CourseIds (required) array<integer> An array of one or more course ids to enroll the user in.
IsLockedByPrerequisites (required) boolean Should the enrollment enforce course prerequisites?
Timezone (required) string The time zone for the enrollment. This should be a standard time zone name, a list of acceptable values can be found here.
StartDate (optional) datetime The start date of the enrollment in ISO format. If not specified, the enrollment will start immediately.
Due (optional)

object <integer, string>

A date interval object consisting of the following parameters to specify an offset from the start date of the enrollment, i.e. "This enrollment is due 60 days from its start date." If not specified, the enrollment will not have a due date.

  • "Interval" : the number of days, weeks, months, or years to offset
  • "Timeframe" : days, weeks, months, years specified as:
    • "d" – Day(s)
    • "ww" – Week(s)
    • "m" – Month(s)
    • "yyyy" – Year(s)
AccessFromStart (optional) object <integer, string>

A date interval object consisting of the following parameters to specify an offset from the start date of the enrollment, i.e. "This enrollment will expire 120 days from its start date." If not specified, the enrollment will not have an expiration date.

  • "Interval" : the number of days, weeks, months, or years to offset
  • "Timeframe" : days, weeks, months, years specified as:
    • "d" – Day(s)
    • "ww" – Week(s)
    • "m" – Month(s)
    • "yyyy" – Year(s)
AccessFromFirstLaunch (optional) object <integer, string>

A date interval object consisting of the following parameters to specify an offset from the date the user first launches the enrollment, i.e. "This enrollment will expire 120 days from the date the user first accesses it." If not specified, the enrollment will not have an expiration date.

  • "Interval" : the number of days, weeks, months, or years to offset
  • "Timeframe" : days, weeks, months, years specified as:
    • "d" – Day(s)
    • "ww" – Week(s)
    • "m" – Month(s)
    • "yyyy" – Year(s)

Example:

{ 	"IdUser": 2, 	"CourseIds": [ 123 ], 	"IsLockedByPrerequisites": true, 	"Timezone": "Eastern Standard Time", 	"StartDate": "2021-07-01", 	"Due": { "Interval": 30, "Timeframe": "d" }, 	"AccessFromStart": null, 	"AccessFromFirstLaunch": null	 } 

Response

The id of the course enrollment that was created.

Example:

123456



Get course enrollment details

HTTP Action

GET

Base URL

https://[Your HR Learn LMS Portal URL]

Endpoint URL

/api/courseenrollment/v2/{id}

Request Parameters

NONE

Response

A course enrollment object matching the {id} of the course enrollment.

Example:

{     "Id": 123456,     "IdSite": 2,     "IdCourse": 123,     "IdUser": 2,     "IdGroupEnrollment": null,     "IdRuleSetEnrollment": null,     "IdLearningPathEnrollment": null,     "IdTimezone": 15,     "IsLockedByPrerequisites": true,     "Code": null,     "RevCode": "IHC6D96FLG5M85HA8BFJ65KC8DM79BAG",     "Title": "My Course",     "DtStart": "2021-07-01T04:00:00Z",     "DtDue": "2021-01-31T04:00:00Z",     "DtExpiresFromStart": null,     "DtExpiresFromFirstLaunch": null,     "DtEffectiveExpires": null,     "DtFirstLaunch": null,     "DtCompleted": null,     "DtCreated": "2021-06-29T07:59:18.813Z",     "DtLastSynchronized": "2021-06-29T07:59:18.813Z",     "DueInterval": 30,     "DueTimeframe": "d",     "ExpiresFromStartInterval": null,     "ExpiresFromStartTimeframe": null,     "ExpiresFromFirstLaunchInterval": null,     "ExpiresFromFirstLaunchTimeframe": null,     "IdActivityImport": null,     "NumberOfLessons": 1,     "NumberOfLessonsCompleted": 0,     "IsPartOfLearningPath": false,     "IsPartOfCertification": false,     "IsSelfEnrollment": false,     "CourseEnrollmentLink": "/dashboard/v2/Enrollment.aspx?id=123456" }

Update course enrollment

HTTP Action

PUT

Base URL

https://[Your HR Learn LMS Portal URL]

Endpoint URL

/api/courseenrollment/v2/{id}

Request Parameters

Parameter Data Type Description
IsLockedByPrerequisites (required) boolean Should the enrollment enforce course prerequisites?

Timezone (optional)

* Specify only if changing the time zone.

string The time zone for the enrollment. This should be a standard time zone name, a list of acceptable values can be found here.

Due (optional)

If you are not making changes to this property, the parameter must match the original parameter value.

object <integer, string>

A date interval object consisting of the following parameters to specify an offset from the start date of the enrollment, i.e. "This enrollment is due 60 days from its start date." If not specified, the enrollment will not have a due date.

  • "Interval" : the number of days, weeks, months, or years to offset
  • "Timeframe" : days, weeks, months, years specified as:
    • "d" – Day(s)
    • "ww" – Week(s)
    • "m" – Month(s)
    • "yyyy" – Year(s)

AccessFromStart (optional)

If you are not making changes to this property, the parameter must match the original parameter value.

object <integer, string>

A date interval object consisting of the following parameters to specify an offset from the start date of the enrollment, i.e. "This enrollment will expire 120 days from its start date." If not specified, the enrollment will not have an expiration date.

  • "Interval" : the number of days, weeks, months, or years to offset
  • "Timeframe" : days, weeks, months, years specified as:
    • "d" – Day(s)
    • "ww" – Week(s)
    • "m" – Month(s)
    • "yyyy" – Year(s)

AccessFromFirstLaunch (optional)

If you are not making changes to this property, the parameter must match the original parameter value.

object <integer, string>

A date interval object consisting of the following parameters to specify an offset from the date the user first launches the enrollment, i.e. "This enrollment will expire 120 days from the date the user first accesses it." If not specified, the enrollment will not have an expiration date.

  • "Interval" : the number of days, weeks, months, or years to offset
  • "Timeframe" : days, weeks, months, years specified as:
    • "d" – Day(s)
    • "ww" – Week(s)
    • "m" – Month(s)
    • "yyyy" – Year(s)

Example:

{ 	"IsLockedByPrerequisites": true, 	"StartDate": "2021-07-15", 	"Due": { "Interval": 30, "Timeframe": "d" }, 	"AccessFromStart": null, 	"AccessFromFirstLaunch": null	 } 

Response

The id of the course enrollment.

Example:

123456

Delete course enrollment

HTTP Action

DELETE

Base URL

https://[Your HR Learn LMS Portal URL]

Endpoint URL

/api/courseenrollment/v2/{id}

Request Parameters

NONE

Response

NONE (200 - OK)

Reset course enrollment

HTTP Action

GET

Base URL

https://[Your HR Learn LMS Portal URL]

Endpoint URL

/api/courseenrollment/v2/{id}/reset

Request Parameters

NONE

Response

NONE (200 - OK)