slowprog/calendly-api

Simple Calendly Library

1.0.1 2019-12-05 07:01 UTC

This package is auto-updated.

Last update: 2024-12-05 18:05:25 UTC


README

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.