A simple FullSlate API wrapper written in JavaScript (ES6).
$ npm install fullslate
To use this library, you will need a valid FullSlate API token and key. Based off of the FAQ, to obtain an API token you have to contact their support and the key is usually your FullSlate subdomain (e.g. mycompany.fullslate.com, mycompany would be your key).
All API requests return a Promise, Promise rejections will occur from API failures, missing tokens, and/or bad API calls. Not all API calls require an API token though, see the documentation below.
import FullSlate from 'fullslate';
// Initialize the FullSlate wrapper
const fsapi = new FullSlate({
key: 'Your_FullSlate_key'
token: 'Your_FullSlate_API_token'
});
// Get a list of your employees
fsapi.employees()
.then(employees => {
console.log(employees);
})
.catch(err => {
console.error(err);
})
- Employees
- Services
- Openings
- Cross-realm Openings
- Bookings
- Clients
- Events
- Products
- Vouchers
- Company Configuration
id
(Number) optional - Ifid
provided, will limit returned employees detail to a single employee, if noid
provided an array of employees will be returned.
id
(Number) optional - Ifid
provided, will limit returned services to a single service, if noid
provided an array of services will be returned.
id
(Number|Array) required - The service id or an array of services are required to get the openingsoptions
(Object) optional - See FullSlate API documentation for full options and, example options areemployees
,before
,after
,window
,range
id
(Number) required - The booking id, which will return details of the booking
options
(Object) required - See FullSlate API documentation for full options and descriptions. The booking object at minimum must includeat
,service
,first_name
, andlast_name
and any additional requirements specified by the provider.
The FullSlate API token must be defined for the following calls.
id
(Number) optional - If anumber
is specified, the library will assume it is a clientid
which will limit the response to the specific clientid
. If noid
is specified, a full list of clients will be returned. This first parameter can also be anobject
which will return the full list of clients with theobject
acting as theoptions
.options
(Object) optional - See FullSlate API documentation for full optionsoptions.include
(Array) optional - Additional fields to include in the response API, valid values includeemails
,phone_numbers
,addresses
, andlinks
.
id
(Number) optional - If anumber
is specified, the library will assume it is an eventid
which will limit the response to the specific eventid
. If noid
is specified, a list of events will be returned. The first parameter can also be anobject
which will return the full list of events with theobject
acting as theoptions
.options
(Object) optional - See FullSlate API documentation for full options, date parameters must be in the format ofYYYY-MM-DD
.
id
(Number) optional - Ifid
provided, will limit returned products to a single product, if noid
provided an array of products will be returned.
id
(Number) optional - Ifid
provided, will limit returned vouchers to a single voucher, if noid
provided an array of vouchers will be returned.
To run the test suite, you'll have to define your API key and token as an export
:
$ export FULLSLATE_TOKEN=MY_TOKEN_123456
$ export FULLSLATE_KEY=MY_KEY
$ npm test
- Clean up the code, it's not very DRY
- Implement
Cross-realm Openings
andCompany Configuration
- Make more robust tests