@wwu-restek/srapi

2.0.1 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i @wwu-restek/srapi

Weekly Downloads

0

Version

2.0.1

License

GPL-3.0-or-later

Unpacked Size

19 kB

Total Files

5

Last publish

Collaborators

  • wwurestek
  • wwubrent