leadbi / leadbi-php-sdk
LeadBI SDK
dev-master
2019-05-23 14:45 UTC
Requires
- php: >=5.3.0
- ext-curl: *
- ext-json: *
This package is not auto-updated.
Last update: 2024-09-20 16:09:34 UTC
README
安装
将 LeadBI PHP SDK 添加到 composer.json 文件中作为依赖项
{
"require": {
"leadbi/leadbi-php-sdk": "dev-master"
}
}
考虑用最新版本替换 dev-master 以固定依赖项。
安装 Composer 依赖项
php composer.phar install
使用方法
此示例演示了如何使用 SDK 访问 API。
<?php
require 'vendor/autoload.php';
require 'config.php';
use LeadBI\LeadBIConfig;
use LeadBI\LeadBIAPI;
$config = new LeadBIConfig(ACCESS_ID, SECRET_KEY, ENDPOINT, SECURE);
$config->debug = DEBUG;
$api = new LeadBIAPI($config);
$response = $api->get("/api/v1/websites");
// Show the results
echo '<pre>';
print_r($response);
echo '</pre>';
示例
更多示例可以在 ./examples
目录中找到。