Coder Social home page Coder Social logo

acuity-js's Introduction

Acuity Scheduling API - JS Tool Kit

Welcome to the Acuity Scheduling JS SDK. This SDK provides examples and a standard library for integrating with the Acuity Scheduling API using JS. You can learn more about developing for Acuity Scheduling at developers.acuityscheduling.com.

Installation

This package can be installed for node using npm:

$ npm install --save acuityscheduling

Then require it in your app:

var Acuity = require('acuityscheduling');

Currently our API is only for server-side access and our SDK won't work on the client-side.

Hello World

Here's a basic example to get started. Just set your API credentials and run:

var Acuity = require('acuityscheduling');
var userId = null;
var apiKey = null;

var acuity = Acuity.basic({
  userId: userId,
  apiKey: apiKey
});

acuity.request('/appointments', function (err, res, appointments) {
  if (err) return console.error(err);
  console.log(appointments);
});

Examples

You'll find several examples of different Acuity integrations in the examples/ directory. These examples cover:

Sample examples/config.json

Create a config file with your API credentials to get started. All examples share a common config file containing your Acuity userId and apiKey for basic API access and verifying callbacks. OAuth2 examples require additional OAuth2 client account credentials.

{
	"userId": 1,
	"apiKey": "abc123"
}

Basic API Access

examples/basic/ is a basic API integration for a single account.

Start the example server by doing PORT=8000 node examples/basic/index.js and navigate to 127.0.0.1:8000

Create an Appointment

examples/create-appointment/ is a more advanced API example for scheduling an appointment. In this example, you'll see how to:

  • fetch appoinment types
  • find an available date and time
  • create the appointment

Start the example server by doing PORT=8000 node examples/create-appointment/index.js and navigate to 127.0.0.1:8000

OAuth2 API Access

examples/oauth2/ is an OAuth2 API integration. Use this to get connected with multiple Acuity accounts.

Create a config file with your OAuth2 credentials to get started. If you don't have OAuth2 credentials, please fill out this registration form. Start the example server by doing PORT=8000 node examples/oauth2/index.js and navigate to 127.0.0.1:8000

Sample examples/config.json
{
	"clientId": "N4HgVZbjHVp3HAkR",
	"clientSecret": "H33vYz88sEiKVbl7EMob1URDrqZrvceSCMmZJpAi",
	"redirectUri": "http://127.0.0.1:8000/oauth2"
}

Webhooks

examples/webhooks/ is a sample webhook integration.

Start the example server by doing PORT=8000 node examples/webhooks/index.js and navigate to 127.0.0.1:8000

Custom Sidebar

examples/custom-sidebar/ allows you to display custom information in the appointment details sidebar.

Start the example server by doing PORT=8000 node examples/custom-sidebar/index.js and navigate to 127.0.0.1:8000

acuity-js's People

Contributors

cesutherland avatar helloworld123122344134 avatar phoniks avatar joshpollara avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.