thinkbim / huichuan-php-sdk
超级汇川API
V1.0.0
2021-11-05 03:45 UTC
Requires
- php: >=7.0
- guzzlehttp/guzzle: >=6.2
- monolog/monolog: ^2.2.0
- topthink/framework: ^6.0.0
README
基于ThinkPHP框架,超级汇川广告投放。 按照官方文档进行同步升级。稳定版本1.0.0
安装
composer require thinkbim/huichuan-php-sdk
环境要求
- PHP 7+
- ThinkPHP 6+
配置文件
#新增配置文件 config/huichuan.php return [ 'header' => [ 'username' => '账户名称', 'password' => '账户密码', 'token' => '授权token', 'target' => '代理商下的子账户', 'source' => '请求api来源' ], 'logPath' => 'Log记录目录', 'filePath' => '报表下载目录' ];
使用
use ThinkBIM\UCSDK\HCClient; try { $client = new HCClient(['target' => '代理商账户名称']); $result = $client->account->getAccount(); if(isset($result['header']['status']) && $result['header']['status'] == 0) { //接口请求成功 }else{ //接口失败处理 } } catch (\GuzzleHttp\Exception\GuzzleException $e) { // Guzzle工具请求异常 }