Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@olivercrockett/bookingapis

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@olivercrockett/bookingapis

A simple NPM package to access the BookingAPIs.dev API and allow you to take and manage bookings, hassle free.

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Logo

The booking APIs aim to reduce the data load on the integrator and save them much work of coding in dates, reservations and more. The APIs provide a fully formed JSON for a site for a week, showcasing every appointment and their booked status.

Quick Start

Get your API keys

Your API requests are authenticated using API keys. Any request that doesn't include an API key will return an error.

You can get your API keys in your dashboard at any time, visit developers to generate or get your keys.


See an example of how to use our package


const { Bookings } = require("@olivercrockett/bookingapis");

const apiKey = "YOUR_API_KEY";

// Initialization
const bookings = new Bookings(apiKey);

// Get availability for a week
const site = STRING;
const date = STRING;
bookings
  .getAvailability(site, date)
  .then((response) => {
    console.log("Returned availability : ", response);
  })
  .catch((err) => console.log("Getting availability error : ", err));


// Make a booking
const day_time = STRING;
const note = STRING;
const user = OJBECT;
const metadata = OBJECT;
bookings
  .makeBooking(site, day_time, note, user, metadata)
  .then((response) => {
    console.log("Created booking : ", response);
  })
  .catch((err) => console.log("Creating booking error : ", err));


// Cancel a booking
const bookingId = STRING;
bookings
  .cancelBooking(bookingId)
  .then((response) => {
    console.log("Cancelled booking : ", response);
  })
  .catch((err) => console.log("Cancelling booking error : ", err));


// Get bookings for a time range
const start = STRING; // '2023-06-06T00:00:00.000Z'
const end = STRING; // '2023-06-07T00:00:00.000Z'
bookings
  .getBookings(start, end)
  .then((response) => {
    console.log("Returned bookings : ", response);
  })
  .catch((err) => console.log("Getting bookings error : ", err));


// Get bookings for a site
bookings
  .getBookings(start, end, site)
  .then((response) => {
    console.log("Returned bookings : ", response);
  })
  .catch((err) => console.log("Getting bookings error : ", err));

Installation

This is a Node.js module available through the npm registry.

Before installing, download and install Node.js. Node.js 0.10 or higher is required.

If this is a brand new project, make sure to create a package.json first with the npm init command.

Installation is done using the npm install command:

$ npm install @olivercrockett/bookingapis

Follow our installing guide for more information.

Features

  • Create booking
  • Cancel booking
  • Get list of bookings
  • Get bookings for a dedicated range
  • Easy list of a site's availabilities
  • Support for an unlimited number of sites

Docs & Community

Contributing

The BookingAPIs.dev project welcomes all constructive contributions. Contributions take many forms, from code for bug fixes and enhancements, to additions and fixes to documentation, additional tests, trigging incoming pull requests and issues, and more!

See the Contributing Guide for more technical details on contributing.

Security Issues

If you discover a security vulnerability in PieCard, please see Security Policies and Procedures.

Running Tests

To run the test suite, first install the dependencies, then run npm test:

$ npm install

$ npm test

People

The original author of BookingAPIs.dev and current lead maintainer is [Oliver Crockett](https://github.com/olivercrockett

License

MIT

Keywords

FAQs

Package last updated on 13 Jun 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc