User Courses- Get assigned courses with results, Add & Remove Courses

The following requests relate to adding courses to and removing courses from Users via the Litmos Training Engine API.

Note: All requests must be Authenticated.

List Courses assigned to a User

Get a list of courses currently assigned to a User and the current status of each course.
Access Level: Trainers Only

Request Uri

GET /users/{user-id}/courses

Response

<Courses> 
  <Course> 
   <Id>string [max length 50]</Id> 
   <Code>string [max length 20]</Code>  
   <Name>string [max length 255]</Name>      
   <Active>true/false</Active>  
   <Complete>true/false</Complete>  
   <PercentageComplete>decimal</PercentageComplete>
  <AssignedDate>YYYY-MM-DDTHH:MM:SS.SSS</AssignedDate>
<StartDate>YYYY-MM-DDTHH:MM:SS.SSS</StartDate> <DateCompleted>YYYY-MM-DDTHH:MM:SSS</DateCompleted>  <UpToDate>true/false</UpToDate>
<Overdue>true/false</Overdue>
<CompliantTill>YYYY-MM-DDTHH:MM:SS.SSS</CompliantTill>
<IsLearningPath>true/false</IsLearningPath>
<CourseCreatedDate>YYYY-MM-DDTHH:MM:SS.SSS</CourseCreatedDate>
<CourseCreator></CourseCreator>
<OriginalId></OriginalId>
<ResultId></ResultId>
<AccessTillDate>YYYY-MM-DDTHH:MM:SS.SSS
</Course>  <Course> 
... 
</Course> 
</Courses>

The results fields explained

  • Complete Indicates if the user has completed this course.
  • PercentageComplete The number of modules the user has completed expressed as percentage.
  • AssignedDate The date the user was assigned the course.
  • StartDate The date the user started the course.
  • DateCompleted Indicates the date the user completed this course.
  • UpToDate Indicates if the course has changed since the user completed it.

List all User Results for a Course

It is possible to get all results of currently assigned users to a specific course.

Access level: Administrators only

GET /courses/{course-id}/users?apikey={apikey}&source={source}

List Modules for a Course

Get a list of all modules under a course.

Request Uri

GET /courses/{course-id}/modules?apikey={apikey}&source={source}

Response

<Modules> 
 <Module> 
  <Id>string [max length 50]</Id> 
  <Code>string [max length 20]</Code> 
  <Name>string [max length 255]</Name> 
  <Description>string </Description> 
 </Module>
</Modules>
 

List Course and Module Results for a User

It is possible to get course results and module results for a User.

Access level: Administrators only

Request Uri

GET /users/{user-id}/courses/{course-id}?apikey={apikey}&source={source}

Response

<Courses> 
 <Course> 
  <Id>string [max length 50]</Id> 
  <Code>string [max length 20]</Code> 
  <Name>string [max length 255]</Name> 
  <Active>true/false</Active> 
  <Complete>true/false</Complete> 
  <PercentageComplete>decimal</PercentageComplete> 
<AssignedDate>YYYY-MM-DDTHH:MM:SS.SSS</AssignedDate>
<StartDate>YYYY-MM-DDTHH:MM:SS.SSS</StartDate> <DateCompleted>YYYY-MM-DDTHH:MM:SS.SSS</DateCompleted>  <UpToDate>true/false</UpToDate>  <Overdue>true/false</Overdue>  <Modules>  <Module> <Id> string [max length 50]</Id>  <Code> string [max length 50]</Code>  <Name> string [max length 255]</Name>  <Passmark> integer </Passmark>  <Score> integer</Score>  <Completed>true/false</Completed>  <LastUpdated>date</LastUpdated>  <Attempt>integer</Attempt>  </Module>  <Module>  ...  </Module>  </Modules> 
<CourseDueDate>YYYY-MM-DDTHH:MM:SS.SSS<CourseDueDate/>
<OriginalId>string [max length 50]</OriginalId>
<ResultId>string [max length 50]</ResultId>
</Course> 
</Courses> 

The Module fields explained

  • Passmark Indicates the passmark set on the module if one is set (Assessments)
  • Score The score achieved for the module (Assessments)
  • Completed Indicates whether the module is completed or not
  • LastUpdated Indicates the date that the course was last updated. Will return nil if it has not been updated
  • Attempt Indicates the number of attempts that were made on the module

List All Course Results for All Users Since a Specific Date

Get a list of all results for all Users and the current status of each course since a specific date.  In this call, the ‘since’ parameter is required and will fail if it is not present. It will also allow a ‘limit’ parameter of up to 1000 records to keep the record set controlled. The call will fail if the limit parameter is greater than 1000. Use the paging parameters built into the API if there are more than 1000 records returned. 

To return users with a CreatedDate after a specific date add "&since=YYYY-MM-DD" to the end of the request.  For example:  

GET https://api.litmos.com/v1.svc/results/details?apikey=MY-KEY&source=MY-APP&since=2015-12-09

Access level:  Adminsitrators only

Request Uri

GET /results/details

Response

<Users> 
  <User> 
   <Id>string [max length 50]</Id> 
   <UserOriginalId>integer</UserOriginalId> 
<Username>string [max length 50]</Username>
<FirstName>string [max length 255]</FirstName>
<LastName>string [max length 255]</LastName>
<Active>true/false</Active> 
<Email>string [max length 255]</Email>
<AccessLevel>string [Trainee or Trainer]</AccessLevel>
<LoginKey>string [max length 512]</LoginKey>
<CourseId>string [max length 50]</CourseId>
<CourseOriginalId>string [max length 50]</CourseOriginalId> 
<UpdatedDate>YYYY-MM-DDTHH:MM:SS.SSS</UpdatedDate>
<Code>string[max length 255]</Code>
<CourseName>string[max length 2255</CourseName>
<Complete>true/false</Complete> 
<PercentageComplete>decimal</PercentageComplete>
<CompletedDate>YYYY-MM-DDTHH:MM:SSS</CompletedDate> 
<UpToDate>true/false</UpToDate>
<Overdue>true/false</Overdue>
<CompliantTillDate>YYYY-MM-DDTHH:MM:SSS</CompliantTillDate>
</User> 
<User> 
... 
</User> 
</Users>

 

Assign Courses to a User

Add a list of courses to a User. If the courses already exist in the team or if the course ids are invalid they will be ignored. Emails will be sent notifying the user of the course assignment providing they have previously logged into their account. It is possible to disable sending course invitation emails by adding the following querystring parameter to the end of the uri : &sendmessage=false.

Access level: Trainers only

Request Uri

POST /users/{user-id}/courses

Request Body

<Courses> 
  <Course> 
   <Id>string [max length 50]</Id> 
   </Course> 
   <Course> 
   <Id>string [max length 50]</Id> 
  </Course> 
</Courses>

Response

Returns a HTTP status code 201 on success

Remove Courses from a User

Courses can only be removed from a User one per request.

Access Level: Trainers Only

Request Uri

DELETE /users/{user-id}/courses/{course-id}

Response

Returns a HTTP status code 200 on success

Have more questions? Submit a request

0 Comments

Article is closed for comments.