PHP code example of forward-force / daxko-api-sdk

1. Go to this page and download the library: Download forward-force/daxko-api-sdk 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/ */

    

forward-force / daxko-api-sdk example snippets


$apiToken = \ForwardForce\Daxko\Daxko::getToken(
    '<client_id>',
    '<client_secret>',
    '<scope>',
    '<grant_type>'
);

$daxkoClient = new \ForwardForce\Daxko\Daxko($apiToken['access_token']);

$apiToken = Daxko::refreshToken(
    '<client_id>',
    '<refresh_token>',
);

$classes = $daxkoClient->classes()
    ->all([
        'startDate' => '<2020-02-09>',
        'endDate' => '<2021-02-09>',
        'locationId' => '<5506>',
    ]);

$class = $daxkoClient->classes()->get('<class_id>');

$name = $class->name; // the actual class name

$class = $daxkoClient->classes()->get('<class_id>');

 if ($class->hasErrors()) {
    var_dump($class->getErrors()));
}