PHP code example of paravibe / gototraining

1. Go to this page and download the library: Download paravibe/gototraining 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/ */

    

paravibe / gototraining example snippets


$get = $client->createRequest('GET', "organizers/{$organizer_key}/trainings")->execute();
$data = $get->getDecodedBody();

$post_data = array(
  'name' => 'Training',
  'description' => 'Test API integration',
  'times' => [
    [
      'startDate' => '2021-03-02T12:00:00Z',
      'endDate' => '2021-03-02T13:00:00Z',
    ]
  ],
  'timeZone' => 'Europe/Kiev',
);

$new = $client->createRequest('POST', "organizers/{$organizer_key}/trainings")
  ->attachBody($post_data)
  ->execute();