Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
@olivercrockett/bookingapis
Advanced tools
Readme
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.
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));
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.
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.
If you discover a security vulnerability in PieCard, please see Security Policies and Procedures.
To run the test suite, first install the dependencies, then run npm test
:
$ npm install
$ npm test
The original author of BookingAPIs.dev and current lead maintainer is [Oliver Crockett](https://github.com/olivercrockett
FAQs
A simple NPM package to access the BookingAPIs.dev API and allow you to take and manage bookings, hassle free.
The npm package @olivercrockett/bookingapis receives a total of 5 weekly downloads. As such, @olivercrockett/bookingapis popularity was classified as not popular.
We found that @olivercrockett/bookingapis demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.