lonnylot / clarityboard-php-sdk
PHP Clarityboard SDK
v2.0
2018-10-11 08:43 UTC
Requires
- php: ^5.4 || ^7.0
- guzzlehttp/guzzle: ^6.3
Requires (Dev)
- phpunit/phpunit: ^7.3
- spatie/phpunit-watcher: ^1.6
This package is auto-updated.
Last update: 2024-09-12 04:35:11 UTC
README
这是 Clarityboard 的 PHP SDK。请参阅我们的 API 文档 了解更多信息。
要求
PHP 5.4.0 及更高版本。
Composer
您可以通过 Composer 安装绑定。运行以下命令
composer require lonnylot/clarityboard-php-sdk
要使用绑定,请使用 Composer 的自动加载
require_once('vendor/autoload.php');
依赖
此库需要 GuzzleHTTP 库。
入门
在使用 SDK 端点之前,您必须设置您的 API 密钥
\Clarityboard\Client::setApiKey('enter-your-api-key');
以下是一个同步调用的示例
$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 ] ]);