API: enrollSessionHistory
  • 4 Minutes to read
  • Dark
    Light

API: enrollSessionHistory

  • Dark
    Light

Article summary

  • Starting June 1, 2022, SmarterU will require all API calls to POST to HTTPS. Any POST to HTTP will result in the SU:01 error (i.e., No POST data detected.).
  • If you are viewing the help in a language other than English, please change your language to English before copying and pasting any code. All API attributes and functions are in English.
  • Tags are required unless specified.

Description

The enrollSessionHistory method enrolls users in a historical, instructor-led session

To enroll users in a historical online or SCORM course, use the enrollmentHistoryImport method.

Who Has Access

The following users have access to the enrollmentHistoryImport method:

API Call XML Package

<SmarterU>
   <AccountAPI><![CDATA[]]></AccountAPI>
   <UserAPI><![CDATA[]]></UserAPI>
   <Method>enrollSessionHistory</Method>
   <Parameters>
      <LearningModuleEnrollment>
         <Enrollment>
            <User>
               <Email><![CDATA[]]></Email>
                  - OR -
               <EmployeeID><![CDATA[]]></EmployeeID>
            </User>

            <Group>
               <GroupName><![CDATA[]]></GroupName>
                  - OR -
               <GroupID><![CDATA[]]></GroupID>
            </Group>

            <LearningModuleID><![CDATA[]]></LearningModuleID>
            <LearningModuleSessionID><![CDATA[]]></LearningModuleSessionID>
            <EnrollmentStatus><![CDATA[]]></EnrollmentStatus>
            <Grade><![CDATA[]]></Grade>
            <EnrolledDate><![CDATA[]]></EnrolledDate>
         </Enrollment>
      </LearningModuleEnrollment>
   </Parameters>
</SmarterU>

LearningModuleEnrollment Tag Group

The LearningModuleEnrollment tag group is a container for historical, instructor-led session enrollments. 

<LearningModuleEnrollment>
   <Enrollment>
      <User>
         <Email><![CDATA[]]></Email>
            - OR -
         <EmployeeID><![CDATA[]]></EmployeeID>
      </User>

      <Group>
         <GroupName><![CDATA[]]></GroupName>
            - OR -
         <GroupID><![CDATA[]]></GroupID>
      </Group>

      <LearningModuleID><![CDATA[]]></LearningModuleID>
      <LearningModuleSessionID><![CDATA[]]></LearningModuleSessionID>
      <EnrollmentStatus><![CDATA[]]></EnrollmentStatus>
      <Grade><![CDATA[]]></Grade>
      <EnrolledDate><![CDATA[]]></EnrolledDate>
   </Enrollment>
</LearningModuleEnrollment>

The LearningModuleEnrollment tag contains the following.

Enrollment

A container for the historical, instructor-led session enrollment. Refer to Enrollment Tag Group

Enrollment Tag Group

The Enrollment tag group is a container for a historical, instructor-led session enrollment. 

<Enrollment>
   <User>
      <Email><![CDATA[]]></Email>
         - OR -
      <EmployeeID><![CDATA[]]></EmployeeID>
   </User>

   <Group>
      <GroupName><![CDATA[]]></GroupName>
         - OR -
      <GroupID><![CDATA[]]></GroupID>
   </Group>

   <LearningModuleID><![CDATA[]]></LearningModuleID>
   <LearningModuleSessionID><![CDATA[]]></LearningModuleSessionID>
   <EnrollmentStatus><![CDATA[]]></EnrollmentStatus>
   <Grade><![CDATA[]]></Grade>
   <EnrolledDate><![CDATA[]]></EnrolledDate>
 </Enrollment>

Each enrollment is contained in an Enrollment tag and may contain the following. 

User

The user to enroll in a historical, instructor-led session. The User tag contains one of the following.

TagDescription

Email

The user's email address. This tag is mutually exclusive with the EmployeeID tag. This is the Email returned by the getUser and listUsers methods. 

EmployeeID

The user's employee ID. This tag is mutually exclusive with the Email tag. This is the EmployeeID returned by the getUser and listUsers methods.

Group

The enrollment group.

The user you are enrolling must already be assigned to the group.

The Group tag contains one of the following.

TagDescription

GroupName

The group's name. This is mutually exclusive with the GroupID tag. This is the Name returned by the getGroup and listGroups methods. 

GroupID

The group's user-specified identifier. This is mutually exclusive with the GroupName tag. This is the GroupID returned by the getGroup and listGroups methods.

LearningModuleID

The instructor-led course's system-generated identifier. This is the LearningModuleID returned by listLearningModule, and the ID returned by getLearnerReport.

LearningModuleSessionID

The session's system-generated identifier. This is the CourseSessionID returned by the listSessions method.

EnrollmentStatus

The progress status of the enrollment. Acceptable values are: 

  • NotAttended - The user did not attend the session. 
  • Attended - The user attended the session.
  • Completed - The user attended and completed the session.

Grade

This tag only applies if the session is graded and the EnrollmentStatus tag is set to Completed. The user's grade. Acceptable values will depend on the grade type:

  • LetterGrade - Up to 5 characters.
  • PassFail - Pass or Fail.
  • Percentage - A number between 0-100.

EnrolledDate

The date of the enrollment.

API Response XML Package

The API response XML package will always include a Result, Info, and Errors tag.

<SmarterU>
   <Result></Result>
   <Info>
      <Enrollments>
         <Enrollment>
            <User><![CDATA[]]></User>
            <LearningModuleID><![CDATA[]]></LearningModuleID>
         </Enrollment>
      </Enrollments>
   </Info>

   <Errors>
      <Error>
         <ErrorID></ErrorID>
         <ErrorMessage></ErrorMessage>
      </Error>
   </Errors>
</SmarterU>

The Enrollments tag is a container for the historical instructor-led session enrollments processed by the enrollSessionHistory method. Each enrollment is contained in an Enrollment tag and may contain the following.

User

The user's identifier. This returns the same value that was provided in the Enrollment tag group

LearningModuleID

The course's system-generated identifier. This returns the same value that was provided in the Enrollment Tag group.

Because this method can be used to perform multiple enrollments, be sure to check the Errors tag for error codes. It's possible for the Result tag to return Success even when errors are returned.

Example API Response XML Package

Below is an example of an API response XML package.

<SmarterU>
   <Result>Success</Result>
   <Info>
      <Enrollments>
         <Enrollment block="1">
            <User><![CDATA[dana.brown@finashoes.com]]></User>
            <LearningModuleID>3860</LearningModuleID>
         </Enrollment>
      </Enrollments>
   </Info>

   <Errors>
   </Errors>
</SmarterU>

Error Codes

Error CodeMessage
ESH:01
The Email provided is not valid.
ESH:02
The EmployeeID provided is not valid.
ESH:03
The GroupName provided is not valid.
ESH:04
The GroupID provided is not valid.
ESH:05
The LearningModuleID provided is not valid.
ESH:06
The LearningModuleSessionID provided is not valid.
ESH:07
The EnrollmentStatus provided is not valid.
ESH:09
The Grade provided is not valid.
ESH:10
The EnrolledDate provided is not valid.
ESH:11
The required permissions are not met to call the enrollmentSessionHistory method.
ESH:12
Enrollment [block #] - Enrolled date provided is not valid.
ESH:13
Enrollment [block #] - Enrollment Status is not valid. Valid statuses are 'NotAttended', 'Attended' or 'Completed'.
ESH:14
Enrollment [block #] - The Learning Module ID provided is not valid.
ESH:15
Enrollment [block #] - The Learning Module Session ID provided is not valid.
ESH:16
Enrollment [block #] - The Learning Module Session ID was not provided.
ESH:17
Enrollment [block #] - Grade is not valid for session with grade type 'Letter Grade'. Letter Grade must be 5 characters or less.
ESH:18
Enrollment [block #] - Grade is not valid for session with grade type 'Pass/Fail'. Valid values are 'Pass' and 'Fail'.
ESH:19
Enrollment [block #] - Grade is not valid for session with grade type 'Percentage'.
ESH:20
Enrollment [block #] - If enrollment status is Not Attended, user cannot have a grade.
ESH:21
Enrollment [block #] - The email address '[user email]' is not a valid user.
ESH:22
Enrollment [block #] - The employee id '[employee id]' is not a valid user.
ESH:23
The group name '[group name]' is not valid.
ESH:24
The group identifier '[group id]' is not valid.
ESH:25
You do not have permissions to assign a user a course under the group selected.
ESH:26
The user provided is already enrolled into the session.
ESH:27
The course is not assigned to the learner's group.
ESH:28
Historical Session enrollment failed.



Was this article helpful?