This is the Clarityboard SDK for PHP. Please refer to our API Docs for more information.
PHP 5.4.0 and later.
You can install the bindings via Composer. Run the following command:
composer require lonnylot/clarityboard-php-sdk
To use the bindings, use Composer's autoload:
require_once('vendor/autoload.php');
The library requires the GuzzleHTTP library.
Before using the SDK endpoints you must set your API key:
\Clarityboard\Client::setApiKey('enter-your-api-key');
Here is an example of making the call synchronously:
$response = \Clarityboard\Dashboard::retrieve(['dashboardId' => 'd290f1ee-6c54-4b01-90e6-d701748f0851']);
$response = \Clarityboard\Dashboard::all();
\Clarityboard\Dashboard::create(['name' => 'My New Dashboard']);
$response = \Clarityboard\Dashboard::retrieve(['dashboardId' => 'd290f1ee-6c54-4b01-90e6-d701748f0851']);
\Clarityboard\Dashboard::create([
'group' => 'Sales',
'data' => [
"name" => "Shoe Laces",
"sale" => 4.99,
"cost" => 0.99
]
]);
$response = \Clarityboard\RecordGroup::all();
$response = RecordGroup::update(['group' => 'Sales', 'data' => ['Purchase Date' => '2018-09-17T18:24:00']]);
$response = Record::create([
'group' => 'Sales', 'data' => [
"name" => "Shoe Laces",
"sale" => 4.99,
"cost" => 0.99
]
]);