A node.js client for the OnboardIQ API
This module is a third-party Client API and not supported by OnboardIQ
$ npm install onboardiq
The module supports all OnboardIQ API v1 endpoints. For complete information about the api, head to the API Docs: v1 or v2
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);
Some endpoints are only available if you are using OnboardIQ's v2 API
// Lists all labels on the applicant
Client.listApplicantsLabels(applicant_id);
// Updates a specific label on an applicant
Client.updateApplicantsLabels(applicant_id, label_title, is_completed);
// Lists all labels on the stage
Client.listStagesLabels(stage_id);
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": {}
}
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
});
Please refer to the Contributing.md docs for more info
Copy the ENV file and add your API confidentials for OnboardIQ
cp .env.example .env
Then run the tests
npm test
See License