API Documentation
Documentation for use with the API
There are certain operations that can be used remotely, via an API call. API calls are performed using standard HTTP RESTlet calls, with JSON as the main payload. All calls are authenticated using BASIC AUTH mechanism using an API-enabled Company/Network Administrator account. It is recommended you create a dedicated company admin user for API calls, enabling their API status flag.
The endpoint to use is: https://api.nscsafety.com
This endpoint is used to register and assign a new user to a library using an Access Code. The company must be setup to accept Access Code registrations. This call will fail if the access code is invalid or there is not enough licenses available.
If the company has custom sign-up fields, these can be passed to the call. The field names for each custom field can be found in the 'Sign-up Fields' within the company. Any field that is marked as required, and not presented with the API will fail.
Sample POST body
{ "companyId" : "06IvGQWyQPRJE9zx", // Company ID; found in the URL of the LMS+ Admin when viewing a particular company "accessCode" : "ACCESSCODE", // The pre-registered AccessCode of the company "loginId" : "user-00010", // Unique loginId of the user to create "password" : "SomeSecurePass", // Initial password of the user "fname" : "User", // The first name of the user "lname" : "Surname", // The last name of the user "driverslicense" : "abcdef123456", // Optional sign-up field "dateofbirth" : "2020-02-11" }
Sample response body
{ "success": true, // flag to indicate success "loginId": "user-00010", // loginId of the user just created "tokenId": "4fViraDfKd4noFOv0Dh9yf" // tokenId for unique tracking "accessCode" : "ACCESSCODE" // The accessCode that was registered }
A 401 response code indicates the user you are using is not authorized. A 500 will indicate an error has occurred, field missing for example.
This endpoint is used to register and assign a new user to a library. Prior to calling this method, the company must be setup with the allowed libraries. This is managed under the 'Retail' for a given company.
If the company has custom sign-up fields, these can be passed to the call. The field names for each custom field can be found in the 'Sign-up Fields' within the company. Any field that is marked as required, and not presented with the API will fail.
Sample POST body
{ "companyId" : "06IvGQWyQPRJE9zx", // Company ID; found in the URL of the LMS+ Admin when viewing a particular company "librarySku" : "sku_120", // The SKU of the library you wish to register this user for; found in the 'Retail' section of a company "loginId" : "user-00010", // Unique loginId of the user to create "password" : "SomeSecurePass", // Initial password of the user "fname" : "User", // The first name of the user "lname" : "Surname", // The last name of the user "driverslicense" : "abcdef123456", // Optional sign-up field "dateofbirth" : "2020-02-11" }
Sample response body
{ "success": true, // flag to indicate success "loginId": "user-00010", // loginId of the user just created "tokenId": "4fViraDfKd4noFOv0Dh9yf" // tokenId for unique tracking }
A 401 response code indicates the user you are using is not authorized. A 500 will indicate an error has occurred, field missing for example.
Start here by creating a new company