@efounders/workable-client
v1.0.0-beta.3
Published
Workable API node client
Downloads
7
Readme
Workable API Client
Motivation
This is a simple wrapper around the Workable API v3.
Installation
npm install @efounders/workable-client --save
Quick start
import Workable from '@efounders/workable-client';
// provide your workable access token to instantiate a workable client
const workable = Workable.client(process.env.WORKABLE_ACCESS_TOKEN);
// lists all the accounts you have access to
workable.accounts().list().then(({ accounts }) => {
const [{ subdomain }] = accounts;
const account = workable.accounts(subdomain);
// lists every members of the first account
account.members().list().then(({ members }) => {
members.forEach((member) => console.log(member.name));
});
});
Not using ES2015?
Import the module this way instead:
var Workable = require('@efounders/workable-client').default;
Running the example
git clone https://github.com/eFounders/efounders-workable-client.git
cd efounders-workable-client/example
npm install
WORKABLE_ACCESS_TOKEN=YOUR_TOKEN npm start
Usage overview
Every API endpoint maps to a method on the workable client.
Each method returns a Promise
that resolves to the JSON parsed from the returned response.
For paginated responses such as jobs listing or candidates listing, there's also an additional helper method to handle pagination and return all results in a single call.
Methods list
workable.accounts().list()
workable.accounts(subdomain).members().list()
workable.accounts(subdomain).recruiters().list()
workable.accounts(subdomain).stages().list()
workable.accounts(subdomain).jobs().list()
workable.accounts(subdomain).jobs().listAll()
workable.accounts(subdomain).jobs(shortcode).info()
workable.accounts(subdomain).jobs(shortcode).questions().list()
workable.accounts(subdomain).jobs(shortcode).members().list()
workable.accounts(subdomain).jobs(shortcode).recruiters().list()
workable.accounts(subdomain).jobs(shortcode).candidates().list()
workable.accounts(subdomain).jobs(shortcode).candidates().listAll()
workable.accounts(subdomain).jobs(shortcode).candidates(id).info()
workable.accounts(subdomain).jobs(shortcode).candidates().create()
workable.accounts(subdomain).jobs(shortcode).applicationForm().info()
Copyright
Copyright © eFounders MIT License; see LICENSE for further details.