PHP code example of openagenda / sdk-php

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

    

openagenda / sdk-php example snippets


$public_key = 'mypublickey';
$oa = new \OpenAgendaSdk\OpenAgendaSdk($public_key);

$oa = new \OpenAgendaSdk\OpenAgendaSdk($public_key, [RequestOptions::PROXY => '127.0.0.1:8888']);

$agendaUid = 123456;
$json = $oa->getAgenda($agendaUid);

$agendaUid = 123456;
$json = $oa->getEvents($agendaUid);

$agendaUid = 123456;
$json = $oa->getEvents($agendaUid, ['search' => 'Concert']);
$newjson = $oa->getEvents($agendaUid, ['search' => 'Concert', 'sort' => 'timings.asc', 'feature' => 1]);

$agendaUid = 123456;
$eventUid = 654321;
$json = $oa->getEvent($agendaUid, $eventUid);

composer 

./vendor/bin/phpunit ./vendor/openagenda/sdk-php/tests

Testing /your-project-folder/vendor/openagenda/sdk-php/tests
......                                                              6 / 6 (100%)

Time: 00:00.026, Memory: 10.00 MB

OK (6 tests, 11 assertions)