1.0.0 • Published 8 years ago

onboardiq v1.0.0

Weekly downloads
6
License
SEE LICENSE IN LI...
Repository
github
Last release
8 years ago

OnboardIQ GitHub version npm version

A node.js client for the OnboardIQ API

This module is a third-party Client API and not supported by OnboardIQ

Table of Contents

Install

$ npm install onboardiq

Getting Started

The module supports all OnboardIQ API v1 endpoints. For complete information about the api, head to the API Docs: v1 or v2

Endpoints

All endpoints return a JS Promise. See Callbacks for more details

var OnboardIQ = require('onboardiq');
var Client = new OnboardIQ.Client(API_TOKEN, API_VERSION);

// Creates a new applicant
Client.addApplicant(params);

// Modifies an existing applicant
Client.updateApplicant(id, params);

// Lists all applicants
Client.listApplicants();

// Deletes an existing applicant
Client.deleteApplicant(id);

Callbacks

All endpoints return a Promise. Below is a successful example on how to consume a Promise:

Client.listApplicants().then(function(resp) {
  // do something with the resp
});

All endpoints return a response object. An example object is shown below. The return data is the information returned by the OnboardIQ API. Please refer to their docs on how to consume it >> v1 or v2

{
	"statusCode": 200,
	"data": {}
}

Error Handling

If an error occurs with executing an API endpoint. Please use the .catch Promise method to handle it. Below is an example. The returned error is from OnboardIQ. Please refer to their docs on how to consume it >> v1 or v2.

It is a good practice to have a catch method call on all executed Promises!

Client.listApplicants().then(function(resp) {
  // do something with the resp
}).catch(function(err) {
  // do something with the error
});

Support

Please refer to the Contributing.md docs for more info

Tests

Copy the ENV file and add your API confidentials for OnboardIQ

cp .env.example .env

Then run the tests

npm test

License

See License