infobird / openapi
v0.1.5.2
2020-11-24 03:58 UTC
Requires
- php: >=5.3
Requires (Dev)
- phpunit/phpunit: ~4.0
README
infobird openapi SDK for PHP
https://packagist.org.cn/packages/infobird/openapi
运行环境
- PHP 5.3+.
- cURL 扩展。
使用方法
首先安装库
composer require infobird/openapiconfig.ini 应该位于根路径,并且需要配置 openapi.url
在 index.php 文件中需要添加
require './vendor/autoload.php';
然后
use \Infobird\Openapi\Client; $token = $this->_request->token; $systemId = $this->_request->version_id; $corpType = $this->_request->isfz?:0; if(empty($token)){ echo 'token not found!';exit; } $c = new Client($token,$systemId,$corpType); $res = $c->auth(); $res = json_decode($res,true); if($res['code']!=='0'){ echo $res['msg'];exit; }