@wwu-restek/srapi
v2.0.1
Published
This module (class) simplifies the process of implementing calls to StarRez's REST API by providing a few wrapper functions.
Downloads
6
Readme
StarRez API Wrapper for Node.js
This module (class) simplifies the process of implementing calls to StarRez's REST API by providing a few wrapper functions.
The module requires a file named sr-credentials.json in the project root (same directory as your main file). This file is not included, for security reasons. It should look something like:
{
"user": "<your StarRez user name with API permissions>",
"token": "abcdefg1234567"
}
You'll have to get the token from the StarRez web client. You cannot use your password.
Documentation is not complete.
Crash Course
The module exports a single class: SRAPI. You must instantiate an SRAPI object by passsing a boolean value indicating whether you want to use the production database. Otherwise, it defaults to the sandbox environment.
To use SRAPI, do something like this:
const SRAPI = require('./srapi/api');
const sr = new SRAPI(false);
sr.get('Entry', 6410).then((me) => {
console.log(me.NameFirst);
}).catch(console.error);
Refer to the JSDocs for more information about the various methods.