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.
Get Courses assigned to a User
Get a list of courses currently assigned to a User and the current status of each course.
Access Level: Account Owners Only
Request Uri
GET /users/{user-id}/courses?
Response (XML)
<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>string [max length 50]</CourseCreator>
<OriginalId>integer</OriginalId>
<ResultId>string [max length 50]</ResultId>
<AccessTillDate>YYYY-MM-DDTHH:MM:SS.SSS</AccessTillDate>
</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.
Request Assigned Courses for a List of Users
Fetches the courses assignments for a specific list of users (no greater than a list of 25 users).
Access level: Administrators only
Request Uri
POST /users/courses?source=MyApp
Request Body (XML)
<Users>
<User>
<Id></Id>
</User>
<User>
<Id></Id>
</User>
<User>
<Id></Id>
</User>
<User>
<Id></Id>
</User>
</Users>
Response Body (XML)
<Users xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<User>
<Id></Id>
<Courses>
<Course>
<Id></Id>
<Code/>
<Name></Name>
<Active>true</Active>
<Complete>false</Complete>
<PercentageComplete>0.00</PercentageComplete>
<AssignedDate>2020-12-12T09:18:00.647</AssignedDate>
<StartDate i:nil="true"/>
<DateCompleted i:nil="true"/>
<UpToDate>true</UpToDate>
<Overdue>false</Overdue>
<CompliantTill i:nil="true"/>
<IsLearningPath>false</IsLearningPath>
<CourseCreatedDate>2020-10-15T11:04:33.297</CourseCreatedDate>
<CourseCreator i:nil="true"/>
<OriginalId></OriginalId>
<ResultId></ResultId>
<AccessTillDate i:nil="true"/>
<UserId></UserId>
</Course>
</Courses>
<User>
<Id></Id>
<Courses>
<Course>
<Id></Id>
<Code/>
<Name></Name>
<Active>true</Active>
<Complete>false</Complete>
<PercentageComplete>0.00</PercentageComplete>
<AssignedDate>2020-04-07T11:22:40.327</AssignedDate>
<StartDate i:nil="true"/>
<DateCompleted i:nil="true"/>
<UpToDate>true</UpToDate>
<Overdue>false</Overdue>
<CompliantTill i:nil="true"/>
<IsLearningPath>false</IsLearningPath>
<CourseCreatedDate>2020-04-07T11:04:33.297</CourseCreatedDate>
<CourseCreator i:nil="true"/>
<OriginalId></OriginalId>
<ResultId></ResultId>
<AccessTillDate i:nil="true"/>
<UserId></UserId>
</Course>
<Course>
<Id></Id>
<Code>
<Name></Name>
<Active></Active>
<Complete></Complete>
<PercentageComplete>0.00</PercentageComplete>
<AssignedDate>2020-04-07T11:22:40.327</AssignedDate>
<StartDate>2020-04-12T08:45:40.824</StartDate>
<DateCompleted i:nil="true"/>
<UpToDate></UpToDate>
<Overdue></Overdue>
<ComplaintTill i:nil="true"/>
<IsLearningPath></IsLearningPath>
<CourseCreateDate></CourseCreateDate>
<CourseCreator i:nil="true"/>
<OriginalId></OriginalId>
<ResultId><ResultId>
<AccessTillDate i:nil="true"/>
</Course>
</Courses>
</User>
<Users>
Request Body (JSON)
[
{"Id":""},
{"Id":""},
{"Id":""},
{"Id":""}
]
Response Body (JSON)
[
{
"Id": "AbC123eFg456HiJ789",
"Courses": [
{
"Id": "",
"Code": "Code 123",
"Name": "Example Course Name",
"Active": true,
"Complete": false,
"PercentageComplete": 0.00,
"AssignedDate": "/Date(1234567891011-0000)/",
"StartDate": null,
"DateCompleted": null,
"UpToDate": true,
"Overdue": false,
"CompliantTill": null,
"IsLearningPath": false,
"CourseCreatedDate": "/Date(1234567891011-0000)/",
"CourseCreator": null,
"OriginalId": 1234567,
"ResultId": 123456789,
"AccessTillDate": null,
"UserId": "AbCDeFg123456HiJ789"
},
{
"Id": "AbC123456eFgHiJ789",
"Code": "Code 123",
"Name": "Example LP Name",
"Active": true,
"Complete": false,
"PercentageComplete": 0.00,
"AssignedDate": "/Date(1234567891011-0000)/",
"StartDate": null,
"DateCompleted": null,
"UpToDate": true,
"Overdue": false,
"CompliantTill": null,
"IsLearningPath": true,
"CourseCreatedDate": "/Date(1234567891011-0000)/",
"CourseCreator": null,
"OriginalId": 1234566,
"ResultId": 123456788,
"AccessTillDate": null,
"UserId": "AbCDeFg123456789HiJ"
}
]
},
{
"Id": "",
"Courses": [
{
..........
}
]
},
]
Get 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
Request Uri
GET /courses/{course-id}/users?
Response (XML)
<Users xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<User>
<Id>string [max length 50]</Id>
<UserName>string [max length 255]</UserName>
<FirstName>string [max length 100]</FirstName>
<LastName>string [max length 100]</LastName>
<Completed>true/false</Completed>
<PercentageComplete>decimal</PercentageComplete>
<CompliantTill i:nil="true"/>
<DueDate i:nil="true"/>
<AccessTillDate i:nil="true"/>
</User>
<User>
.....
</User>
</Users>
Get 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}?
Response (XML)
<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>integer</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
Get 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 course results that have changed since a specific date, use the "&since=YYYY-MM-DD" parameter on the end of the request. For example:
GET https://api.litmos.com/v1.svc/results/details?source=MY-APP&since=2015-12-09
Access level: Administrators only
Request Uri
GET /results/details?
Response (XML)
<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 (XML)
<Courses> <Course> <Id>string [max length 50]</Id> </Course> <Course> <Id>string [max length 50]</Id> </Course> </Courses>
Request Body (JSON)
[
{
"Id": "bYWg1D67tgo1"
}
]
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
Comments
0 comments
Article is closed for comments.