API: unenrollLearningModules
  • 1 Minute to read
  • Dark
    Light

API: unenrollLearningModules

  • 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 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.

The unenrollLearningModules method supports up to 100 unenrollments per call.

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.

Because this method can be used to perform multiple unenrollments, 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>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%.

Was this article helpful?