Skip to content
Acuity Scheduling API - PHP Tool Kit
Branch: master
Clone or download
cesutherland Merge pull request #4 from Codentia/master
Amend check on state parameter to avoid errors in strict mode
Latest commit e0810aa Apr 10, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples
src Amend check on state parameter to avoid errors in strict mode Apr 7, 2017
.editorconfig
.gitignore
LICENSE Add MIT license. Aug 18, 2015
README.md Update reamde. Mar 18, 2016
composer.json Initial create-appointment example. Mar 17, 2016
composer.lock

README.md

Acuity Scheduling API - PHP Tool Kit

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

Installation

This package can be installed with composer or added to your application manually. To install with composer, first execute in a shell:

$ composer require acuityscheduling/acuityscheduling

Then include the vendor/autoload.php in your app.

<?php
require_once('vendor/autoload.php');

If you're installing manually, simply include the AcuityScheduling.php file in your app.

Hello World

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

<?php
require_once('vendor/autoload.php');

$userId = null;
$apiKey = null;

$acuity = new AcuityScheduling(array(
  'userId' => $userId,
  'apiKey' => $apiKey
));

$appointments = $acuity->request('/appointments');
print_r($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 php -S localhost:8000 -t examples/basic 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 php -S localhost:8000 -t examples/create-appointment 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 php -S localhost:8000 -t examples/oauth2 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 php -S localhost:8000 -t examples/webhooks 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 php -S localhost:8000 -t examples/custom-sidebar and navigate to 127.0.0.1:8000

You can’t perform that action at this time.