SmarterU Success Center

API: unenrollLearningModules

Description

The unenrollLearningModules method does a batch unenroll.

Who Has Access

Administrators or owners have access to the unenrollLearningModules method.

API Call XML Package

<SmarterU>
   <AccountAPI><![CDATA[]]></AccountAPI>
   <UserAPI><![CDATA[]]></UserAPI>
   <Method>unenrollLearningModules</Method>
   <Parameters>
      <LearningModuleEnrollment>
         <Unenrollment>
            <AccountUserLearningModuleRelID><![CDATA[]]></AccountUserLearningModuleRelID>
         </Unenrollment>
      </LearningModuleEnrollment>
   </Parameters>
</SmarterU>

LearningModuleEnrollment Tag Group

The LearningModuleEnrollment tag group is a container for the course unenrollments.

<LearningModuleEnrollment>
   <Unenrollment>
      <AccountUserLearningModuleRelID><![CDATA[]]></AccountUserLearningModuleRelID>
   </Unenrollment>
</LearningModuleEnrollment>

The LearningModuleEnrollment tag may contain the following.

Unenrollment

A container for a course unenrollment. Refer to Unenrollment Tag Group.

Unenrollment Tag Group

The Unenrollment tag group is a container for a course unenrollment.

<Unenrollment>
   <AccountUserLearningModuleRelID><![CDATA[]]></AccountUserLearningModuleRelID>
</Unenrollment>

Each course unenrollment is contained in an Unenrollment tag and may contain the following.

AccountUserLearningModuleRelID

The course enrollment's system-generated identifier. This is the AccountUserLearningModuleRelID value returned by enrollLearningModules, and the ID value returned by getLearnerReport.

API Response XML Package

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

<SmarterU>
   <Result></Result>
   <Info>
      <Unenrollments>
         <Unenrollment block=”1”>
            <AccountUserLearningModuleRelID></AccountUserLearningModuleRelID>
         </Unenrollment>
      </Unenrollments>

      <Unenrollments>
         <Unenrollment block=”3”>
            <AccountUserLearningModuleRelID></AccountUserLearningModuleRelID>
         </Unenrollment>
      </Unenrollments>
   </Info>
 
   <Errors>
      <Error block="2">
         <ErrorID></ErrorID>
         <ErrorMessage></ErrorMessage>
      </Error>
   </Errors>
</SmarterU>

The Unenrollments tag is a container for the course unenrollments processed by the unenrollLearningModules method. Each course unenrollment is contained in an Unenrollment tag and may contain the following.

AccountUserLearningModuleRelID

The course enrollment's system-generated identifier.

Example API Response XML Package

Below is an example of an API response XML package.

<SmarterU>
   <Result>Failed</Result>
   <Info>
      <Unenrollments>
         <Unenrollment block="2">
            <AccountUserLearningModuleRelID>17335503</AccountUserLearningModuleRelID>
         </Unenrollment>
     </Unenrollments>
   </Info>

   <Errors>
      <Error Block="1">
         <ErrorID>ULM:03</ErrorID>
         <ErrorMessage>Unenrollment 1 - The AccountUserLearningModuleRelID provided is not valid.</ErrorMessage>
      </Error>
   </Errors>
</SmarterU>

Error Codes

Error CodeMessage
ULM:01
AccountUserLearningModuleRelID provided is not valid.
ULM:02
The required permissions are not met to call the unenrollLearningModules method.
ULM:03
Unenrollment %blocknum% - The AccountUserLearningModuleRelID provided is not valid.
ULM:04
Unenrollment %blocknum% - The AccountUserLearningModuleRelID provided is already in the unenrollment queue.
ULM:05
Unenrollment %blocknum% - The AccountUserLearningModuleRelID provided is a duplicate of the AccountUserLearningModuleRelID from Unenrollment %blocknum%.