Skip to content

Latest commit

 

History

History
51 lines (32 loc) · 1.1 KB

README.md

File metadata and controls

51 lines (32 loc) · 1.1 KB

Calendly API wrapper

A simple PHP library for Calendly API. The API's main documentation is available through the API portal.

Installation

To install use composer:

composer require slowprog/calendly-api

Usage

<?php

require 'vendor/autoload.php';

use Calendly\CalendlyApi;
use Calendly\CalendlyApiException;

$calendlyApi = new CalendlyApi('YOUR_API_KEY');

try {
    $calendlyApi->echo();
    
    $webhook = $calendlyApi->createWebhook('https://some.site', [
        CalendlyApi::EVENT_CREATED, 
        CalendlyApi::EVENT_CANCELED,
    ]);
    
    var_dump($webhook['id']);
    
    $webhook = $calendlyApi->getWebhook($webhook['id']);
    
    var_dump($webhook['data'][0]['attributes']['created_at']);
    
    $webhooks = $calendlyApi->getWebhooks();
    
    var_dump(count($webhook['data']));
    
    $calendlyApi->deleteWebhook($webhook['data'][0]['id']);    
} catch (CalendlyApiException $e) {
    var_dump($e->getMessage());
}

License

The MIT License (MIT). Please see License File for more information.