node-bookeo

2.1.1 • Public • Published

node-bookeo

npm package

Node API for Bookeo REST API, based on mappersmith.

Works on the server AND the browser :)

Adds some helpers

Usage

import Bookeo from 'node-bookeo'
 
const bookeo = new Bookeo({ secretKey, apiKey });
 
bookeo.client.bookings.all().then(results => {
  // return bookings
  console.table(results);
})

REST mapping

bookeo.client gives you access to mappersmith instances from src/api.js.

Custom methods
method description
bookeo.bookings(params) GET /bookings
bookeo.booking(id, options) GET /bookings/{bookingId}
bookeo.slots(params) GET /availability/slots
bookeo.products(params) GET /settings/products
bookeo.subaccounts(params) GET /subaccounts
  • bookeo.booking options : expand(false) : expand booking customer + payments

Utilities

method description
bookeo.setApikey(apikey) change API key for next requests
bookeo.getAllSlots(params) return all available slots grouped by products

Permissions

To get ApiKey with correct permission, send this link to user : https://signin.bookeo.com/?authappid=xxxxxx&permissions=bookings_r_all,availability_r,blocks_r_all. see the scopes docs.

Tests

Bookeo
  General
    ✓ add credentials headers to request
    ✓ return data key
  Bookings
    ✓ add default startTime as 'startOfToday'
    ✓ add default endTime when not given
    ✓ return data key
    ✓ pass parameters
  Subaccounts
    ✓ pass parameters
    ✓ return data key
  Products
    ✓ pass parameters
    ✓ return data key
  Slots
    ✓ pass parameters
    ✓ return data key
  getAllSlots
    ✓ should return all slots grouped by product
  booking
    ✓ should request bookeo api
    ✓ expand=false should have no customer, payments
    ✓ expand=true should have customer + payments
  payments
    ✓ should request bookeo api
 
 
18 passing (94ms)
 

See also

Readme

Keywords

Package Sidebar

Install

npm i node-bookeo

Weekly Downloads

8

Version

2.1.1

License

MIT

Last publish

Collaborators

  • revolunet