unifysell / unifysell-sdk-php
为unifysell api提供的带有OAuth2的SDK。
v0.2.6
2019-07-04 08:34 UTC
Requires
- php: >=5.5
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^6.2
Requires (Dev)
- friendsofphp/php-cs-fixer: ~2.12
- phpunit/phpunit: ^4.8
- roave/security-advisories: dev-master
- squizlabs/php_codesniffer: ~2.6
README
此包组合了所需的包组。
安装
通过composer包含包
在composer中使用,请将以下内容添加到require部分:
"require": {
"unifysell/unifysell-sdk-php": "*"
}
安装composer
见https://composer.php.ac.cn/download/
使用
您可以通过查看example/complete-example.php文件来了解基本使用示例。
认证
Download Access Token from unifysell Control Center (UCC).
进行第一次请求
$config = Unifysell\SDK\Configuration::getDefaultConfiguration()->setApiKey(
'Authorization',
'----INSERT BEARER TOKEN HERE----'
);
$config->setApiKeyPrefix('Authorization', 'Bearer');
$apiInstance = new Unifysell\SDK\Api\OrdersApi(
new GuzzleHttp\Client(),
$config
);
$result = $apiInstance->getOrder(1);