Developer API
Litmos' Application Programming Interface (API) enables developers to connect external applications to Litmos LMS. The API gives organizations the ability to streamline data and processes across information systems for operational efficiency, including the automation of training assignments and the moderation of administrative tasks.
We’ve tried hard to make the Litmos API as RESTful as possible where each resource has a unique URI and HTTP verbs are used to specify the action to perform on that resource.
Note: The Litmos API is not enabled on trial accounts. See our pricing page for more details.
Note: Most of the actions performed via the Litmos UI are available via the API. If there is something in particular that you’re looking for and you can’t find it in the documentation please let us know and we will work on making that available.
HTTP Verbs
Any requests for a single resource or list of resources (e.g. course list) will use a GET.
Insert (POST) or update (PUT) requests often require structured XML or JSON in the HTTP request body.
At this stage DELETE requests are not available on all resources and are limited to a few documented requests.
Authentication & Access Level
Every request to the API must be transmitted over a secure channel using HTTPS and authenticated by passing an apikey andsource value in the querystring. Access to most API requests is limited to Account Owners only.
Querystring Parameter | Type | Description |
---|---|---|
apikey | String, max length 50 characters |
Every user in Litmos has a unique apikey. Access to requests on the API is restricted by each users AccessLevel.Eg.Learner, TeamLeader, Administrator, or Account Owner Note: To get API key Contact your Account owner. |
source | String, max length 50 characters | Free text description of your app. Usually a company or product name. |
Making Requests
All requests listed in this document should contain a content-type (XML or JSON) in the request header and be prefixed with the following base Uri:
https://api.litmos.com/v1.svc |
E.g. The Uri to GET a list of Users in XML format would be:
Content-Type: text/xml
GET https://api.litmos.com/v1.svc/users?apikey=MY-KEY&source=MY-APP
Content Type
Communication with the API can be conducted using Plain Old XML (POX) or JavaScript Object Notation (JSON).
With every request you must include a Content-Type header.
Content-Type | Description |
---|---|
text/xml | Plain Old XML (POX) |
application/json | JavaScript Object Notation (JSON) |
The Content-Type that is sent with each request to the API indicates which format the response will be for GET requests and what format the API expects the request body to be in the case of PUT or POST requests. In order to receive JSON format response, please append "&format=json" to the URI. Example:
GET https://api.litmos.com/v1.svc/users?apikey=MY-KEY&source=MY-APP&format=json
Response Codes
Based on RESTful principles this API returns relevant HTTP Status codes when actions succeed or fail.
If a request is successful you will get a status code response in the 200 range and sometimes it will be accompanied by XML or JSON in the response body. Eg. If you successfully update a user then you would get a 200 but if you successfully create a new user you will get a 201 (Created) response back with the XML/JSON for that new user in the body.
If a request fails you will get a non 200 status code and often a description of why the request failed.
Here are some of the common responses codes and things to check
HTTP Status Code | Description |
---|---|
200 | Success. User/Course etc updated, deleted or retrieved |
201 | Success. User/Course etc created |
400 | Bad Request. Check that your Uri and request body is well formed |
403 | Forbidden. Check your API key, HTTPS setting, Source parameter etc |
404 | Not Found. The User/Course etc that you requested does not exist |
409 | Conflict. Often occurs when trying to create an item that already exists |
Date Formats
All fields marked as datetime are recorded in UTC and XML format is returned in ISO 8601 while JSON is returned as a JSON string.
E.g. 2015-04-30T15:36:30
API Usage Limits
Under our standard agreement there is a limit of 100 requests per minute that a provider can make against a particular Litmos account. This rate limit is based on a rolling 60 second window, if the api token has been used more than 100 times in the past 60 seconds you will have exceeded the rate limit and the API will return HTTP 503 (Service Unavailable) - Rating Limit Exceeded.
Search & Paging Parameters
Many of the list based GET requests support searching and paging. If a request is documented as supporting paging the following parameters can be used to filter or restrict the result set returned.
All of the search and paging parameters are optional and can be used singly or in a combination. By default paging will return the first 100 records but you can increase this as required by using the limit parameter.
Querystring Parameter | Description | Possible Values |
---|---|---|
start | Start record | 0+ (Default = 0) |
limit | Total records to return | 1 – 1000 (Default = 100) |
sort | Field to sort results using | FirstName, LastName, UserName, Active, Email |
dir | Direction to sort the records | ASC or DESC (Default = ASC) |
search | String value to filter records using | String. Max length 50 |
Links to API Call Details
Single Sign On
Log straight into a course index/landing page
Courses
Get a list of users Assigned to a Course
User Profile information
Users and Courses/ Modules
List Courses assigned to a User
List all User Results for a Course
List Course and Module Results for a User
List All Course Results for All Users Since a Specific Date
Get a list of Recent Achievements
Reset Course Results for a Learner
Team Leaders
Remove a Team Leader from a Team
Course Assignment to Teams
Team Profile Information
Get a list of Courses assigned to a Team
Add & Remove Users from a Team
Gamification
Get Total Badges and Points For User
Get List of Badges Earned By User
Get List of Achievements Earned By User
Get List of Achievements Earned By Team
Learning Paths
Get Learning paths assigned to a specific User
Assign users to a Learning Path
Remove a user from a Learning Path
Get all Learning Paths assigned to a Team
Assign Learning Paths to a Team
Remove Learning Paths from a Team
Instructor Lead Training (ILT)
Get Session List for an Instructor
Mark Session complete and add score
Comments
0 comments
Article is closed for comments.