New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

dayschedule-api

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dayschedule-api

Dayschedule Node.js package for appointment bookings API

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

dayschedule

version license

Official Node.js library for DaySchedule API to integrate online appointments bookings, reservation and calendar scheduling in any tool with embeddable widget on front-end and this SDK on backend for complete white-label appointment scheduling at any scale.

Installation

npm i dayschedule-api

Documentation

Full API documentation to understand the appointment booking flow with DaySchedule is available at - https://dayschedule.com/docs/api

Getting started

Create a DaySchedule instance with api key. You can get your api keys from the app https://app.dayschedule.com/settings/apikeys

const DaySchedule = require('dayschedule-api');

const daySchedule = new DaySchedule('YOUR_API_KEY');

The SDK is UMD (Universal Module Definition) compatible, which means that it can be loaded in various module formats.

ES6 module
import DaySchedule from 'dayschedule-api'
const daySchedule = new DaySchedule('YOUR_API_KEY');
CommonJS2 (in e.g. node.js)
const DaySchedule = require('dayschedule-api');
const daySchedule = new DaySchedule('YOUR_API_KEY');

Now, the API can be accessed via the daySchedule instance. All the methods follow the namespaced signature. For example, to fetch all the booked appointments -

// API signature
// {daySchedule}.{api}.{method}(id, [params])

// example
const bookings = await daySchedule.bookings.list();

Every request returns a promise.

Methods

Each API endpoint has these 5 methods list, get, create, update, delete API operations. For example, here is the booking API methods -

MethodDescriptionParametersReturn Value
listGet all the bookingsparams: anyPromise<Bookings[]>
getGet details of a booking by IDid: stringPromise<Bookings>
createCreate a new bookingdata: anyPromise<Bookings>
updateUpdate an existing booking by IDid: string, data: anyPromise<Bookings>
deleteDelete a booking by IDid: stringPromise<any>

Booking example:

// Using promises
daySchedule.bookings.create({
    "resource":{
        "resource_id":"643d0e3511ce9450e585c2a9",
    },
    "host":{
        "user_id":758
    },
    "start_at":"2023-10-11T09:00:00.000Z",
    "end_at":"2023-10-11T09:30:00.000Z",
    "invitees":[{
        "name":"John Doe",
        "email":"Johndoe@gmail.com"
        "questions":[
            {
                "type":"text",
                "name":"age",
                "label":"What is your age?",
                "value":"18"
             },
         ]}
    ]
}).then(function(response){
  console.log(response);
}).catch(function(response){
  console.log(response);
});

// Using async/await
const response = await daySchedule.bookings.create({ ... })

More examples

Release

  1. Switch to main branch.
  2. Update the CHANGELOG.md & bump the version in package.json
  3. Commit and Tag the release & push to Github
  4. Create a release on GitHub with changelog
  5. Publish to npm with npm publish command

License

MIT Licensed. See LICENSE.txt for more details

Keywords

FAQs

Package last updated on 23 Oct 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