Getting Started With The Absorb LMS RESTful API

Follow

Applies to: Pro, Plus, & Enterprise Plans

The Absorb RESTful API has been designed to allow customized interactions with your LMS data including learners, courses, departments, grades, etc. You can also use it to build specialized interfaces, unique reports, integrations, and so on. The use of the API will require competent technical web experience on your part but this guide should serve as a jumping off point for those interested. 


What You'll Need To Get Started 

RESTful Client 

For this guide we will be using the Postman app for Chrome as our RESTful client. This article will cover everything you need to know to use it with the Absorb LMS RESTful API, but you can visit Postman - Getting Started if you'd like to learn more about this app. While the workflow in this guide may not be step-by-step the exact same as in your software, the concepts discussed should be universal. 

Your API Private Key 

If you are an Absorb LMS RESTful API customer, you will have been provided with an API private key that is tied to your LMS portal. This key is used to authenticate prior to any requests via the API. If you do not yet have a key, please contact us to discuss purchasing one. 

Your Site URL 

Your LMS URL will be the root location for all API requests, meaning you'll put your site URL before all requests listed in this article. This will be the URL used to access your learner interface. 

Your Admin Credentials 

Your LMS admin credentials will be used as a part of the authentication process. Similar to the admin interface, your admin role will determine which areas of the LMS you are permitted to access through the API. 
RESTful API Help 
RESTful API Help lists out all of the requests available through the Absorb RESTful API, sorted by various functions/areas in the LMS. 


Generating An API Token
 

All requests to the LMS must include an API token as authentication. This token is generated using your API Private Key and your Absorb user account credentials and will be used to verify both client access to the API as well as a specific admin's access to certain LMS data (based on their admin roles set up in the LMS). Tokens are only valid for up to 4 hours after they have been generated. 
 
To generate a token you'll need to make a POST to the following request URL (the examples in red will be replaced with your own variables): 
/api/Rest/v1/Authenticate
  1. Add your site URL to the beginning of the above string 
  2. Change your request type to POST 
  3. The POST will contain the authentication data in the body of the request. Before you can do this, you'll need to specify a content-type as a header in the request. Enter "Content-Type" in the HEADER field and "application/json" in the VALUE field. Enter your credentials as they are shown below. 
  4. Click SEND 
  5. Your API token will be returned in the body of the response below 


Making A GET Request 

GET requests pull data from the LMS and display it in the body of the API response. For example, you could make a request to return a list of all enrollments for a particular user or return information on a particular resource. 
 
In this example we'll send a GET request to return all the information for a particular user. This request can be made to the following request URL: 
/api/Rest/v1/Users/{id} 
  1. Add your site URL to the beginning of the above string 
  2. Change your request type to GET 
  3. Add your API token as a header to authorize the request. In Postman you can enter this after clicking the HEADERS button in the top-right. Enter "Authorization" in the HEADER field and your API token in the VALUE field. 
  4. Fill in the Absorb userID for the user you are returning data for. This can be found in the Id column in Absorb's USERS report, or alternatively returned via the API in other GET requests. 
  5. Click SEND 
  6. A list of learner data will be returned in the body of the response 


Making A POST Request 

POST requests add new data to the LMS and display a confirmation in the body of the API response. For example, you could add a new department or enroll a user in a course. 
 
In this example we'll send a POST request to add a new user to our LMS. This request can be made to the following request URL: 
/api/Rest/v1/createabsorbaccount 
    1. Add your site URL to the beginning of the above string 
    2. Change your request type to POST 
    3. Add your API token as a header to authorize the request. In Postman you can enter this after clicking the HEADERS button in the top-right. Enter "Authorization" in the HEADER field and yourAPI token in the VALUE field. 
    4. Similar to the authentication, set the content-type to application/json.
    5. In this example, we'll send the body of this request in JSON. Change your data mode to RAW and select JSON as the data type for the editor below. 
    6. Click Here for a full list of body parameters that can be sent with this request, but to create a new Absorb user we only need a handful of required parameters. The DepartmentId can be found in the Id column in Absorb's DEPARTMENTS report, or alternatively returned via the API in other GET requests. The rest of these parameters will be the data you are entering for this user.
      {
      "DepartmentId": "399c6b48-9c91-413f-94ca-0a259f773839",
      "FirstName": "Sample",
      "LastName": "User2",
      "Username": "sample.user2",
      "Password": "ab5orb!ap1",
      "EmailAddress": "sampleuser2@absorblms.com" 
  • Click SEND 
  • A confirmation will be returned in the body of the response containing the Id of the newly created user, as well as their username. You can verify that this user has been added by checking the USERS report in the admin interface. 


How To Use Absorb LMS RESTful API Help 

Our Absorb LMS RESTful API Help site documents every API request we currently have in our system, as well as detailed information on all request and response parameters. This page is divided up based on different areas of functionality, called controllers. For example, all resource related API requests are located in the ResourcesController. In each controller section you'll find a list of available request URLs as well as a description. 
 
 
Each request has its own page that will outline detailed information about that request. 
  • Required Permissions will tell you which admin role permissions are necessary to work with the request 
  • Request Information provides a list of both URL paramaters (included in the request URL) and body parameters (included in the body of the request). This list will include a description of each parameter, its data type, and if that parameter is required in the request. Request formats are also included for several requests that will give you a few examples of how your request body can be formatted. 
  • Response Information provides a list of response parameters that will be returned upon successful execution of every request. Response formats are also included for several requests that will give you a few examples of how your response body can be formatted. 
Published on
Have more questions? Submit a request

0 Comments

Article is closed for comments.