API Developer Reference

Getting Started

Javascript SDK

IMPORTANT: The Axis Legacy API is deprecated and has been replaced with the Axis REST API

SDK for Javascript
This SDK is a Javascript based library that makes it easy to use the Axis LMS API in your Javascript or Node.js code.

You can download the SDK files here:

https://files.atrixware.com/files/axis/resources/axisapi.sdk.js.zip

 

Basic Usage
Here is a basic example of calling the Axis API  using the Javascript SDK. This example sets the return type as XML but you can also set it to return as JSON. Note that your code will also have to include the endpoint and API key not shown in this example. Check out the template.html and example html files in the Javascript SDK for more details:
 

axisapi.call({
  endpoint: "user/getlist",
  p1: "admin",
  returntype: "xml",
  oncomplete: function() {
    var result = axisapi.return_value;
    var items = result.getElementsByTagName( "result" );  
    for ( i = 0; i < items.length; i++ ) {  
      console.log(items[i].childNodes[0].nodeValue); 
    }
  }
});

 

While the Axis API natively returns results as XML, using the SDK you can set the result to be returned as either XML or JSON. You can use the built-in Javascript functions to parse through either kind of result. When converted to JSON, the data could be in a few different formats (flat object, or an object of arrays for example, depending on the complexity of the data). 

When handling tagged data which some endpoints return back as values to some nodes, the Javascript SDK has a function to help you parse through the results of that kind of data structure:

axisapi.get_tag_data($tagname, $string)

This function will return the data value for $tagname in the $string containing tagged data.

 

The SDK also has a few variables you can access. These are useful due to the async nature of the language:

axisapi.return_value

This variable holds the return value of the last API call, and is typically used in the oncomplete function of your API call.

axisapi.last_endpoint

This variable holds the last API endpoint, and is in sync with the axisapi.return_value above.

 

The Javascript SDK consists of several library files you will use in your projects ( axisapi.sdk.js and template.html ) and also a few example files that demonstrate how to use API commands with return values in XML and JSON formats.

To set up the Javascript SDK in a browser-based environment, follow these steps:

  1. Create a folder on your web server to put the files.

  2. Unzip the SDK files, and copy to the folder on your web server.

  3. To try the sample files, open them up and populate the required fields with data for your LMS.

 

To use the Javascript SDK in a Node.js server environment:

In production scenarios, you will want to use this SDK in a Node.js setting. You will want to bring in the /lib/ folder and the axisapi.sdk.js inside it into your coding environment, make sure you include jQuery as well (see this article if you need assisance: https://www.geeksforgeeks.org/how-to-use-jquery-with-node-js/). Use the code in the template.html file as a starting point to write your API calls. See the example files for code on processing both XML and JSON results.

 

Axis LMS API Overview
Overview
Getting Started
API Tools
PHP SDK
Javascript SDK
ColdFusion
Understanding Return Values
Certifications Endpoints
certifications/getuserlist
certifications/getuserinfo
certifications/getuserceus
certifications/issueofflinecert
certifications/issueonlinecert
certifications/extend
certifications/getprogramid
certifications/getprogramlist
Course Endpoints
course/getcount
course/getlist
course/getrecord
course/getuserlist
course/enrolluser
course/removeuser
Gradebook Endpoints
gradebook/getreportcard
ILT Endpoints
ilt/disenrolluser
ilt/enrolluser
ilt/getcompletedusers
ilt/getmeetings
ilt/getprograms
ilt/getsessions
ilt/getusersessions
ilt/setuserattendance
Learning Paths Endpoints
learningpaths/enrolluser
learningpaths/disenrolluser
learningpaths/getpaths
learningpaths/getusers
learningpaths/getuserstatus
learningpaths/resetuser
Manager Endpoints
manager/add
manager/demote
manager/assignemployee
manager/moveemployees
manager/getcoursekeywords
manager/setcoursekeywords
manager/getusername
manager/getlist
manager/getcount
manager/getuserlist
manager/getusercount
manager/getmanagerlist
manager/getmanagercount
Organization Endpoints
organizations/adduser
organizations/getbranches
organizations/getlist
organizations/getusercount
organizations/removeuser
Report Endpoints
report/getcourseinfo
report/getcourseactivityinfo
report/getuserinfo
report/getuserarchiveinfo
report/getusercourseinfo
report/getuserdetailedscoreinfo
report/getusertrainingsummary
System Endpoints
system/getapiversion
User Endpoints
user/getcount
user/getlist
user/getrecord
user/getusername
user/getimage
user/getsso
user/add
user/update
user/elevate
user/getmanager
user/assigntomanager
user/enroll
user/disenroll
user/getsysvars
user/getsysvar
user/setsysvar
Usergroup Endpoints
usergroup/getcount
usergroup/getlist
usergroup/add
usergroup/remove
usergroup/getuserlist
usergroup/getusercount
usergroup/adduser
usergroup/removeuser