PHP code example of bookingtime / lib-phpsdk-module

1. Go to this page and download the library: Download bookingtime/lib-phpsdk-module library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

bookingtime / lib-phpsdk-module example snippets



use bookingtime\phpsdkmodule\Sdk;

//create SDK
$sdk=new Sdk(
   '<CLIENT_ID>',
   '',
   ['locale'=>'en','timeout'=>15,'mock'=>FALSE]
);

//load moduleConfig for submitted organizationId/moduleConfigId
$moduleConfig=$sdk->moduleConfig_show([
   'organizationId'=>'f6xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
   'moduleConfigId'=>'5fxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
]);

//list all available bookingTemplates
$bookingTemplateArray=$sdk->bookingTemplate_list([
   'organizationId'=>'f6xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
]);

//get list of possible bookingSlots for selected bookingTemplate and week
$bookingSlotArray=$sdk->bookingSlot_listWeek([
   'organizationId'=>'f6xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
   'bookingTemplateId'=>'fcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
   'year'=>'2023',
   'week'=>'39',
]);

//book a new appointment
$appointment=$sdk->appointment_add([
   'organizationId'=>'f6xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
],[
   'bookingSlotId'=>'brxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
   'notes'=>'My first appointment',
   'customer'=>[
      'gender'=>'MALE',
      'firstName'=>'Max',
      'lastName'=>'Mustermann',
      'email'=>'[email protected]',
   ],
]);