cdma-numiscorner / product-api-client
使用产品API导出产品。
2.0
2021-08-20 09:23 UTC
Requires
- php: >=7.2
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^6.2
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.12
- phpunit/phpunit: ^8.0 || ^9.0
README
身份验证
安装与使用
需求
PHP 7.2 及更高版本。
Composer
要通过Composer安装绑定,请将以下内容添加到 composer.json
{ "repositories": [ { "type": "vcs", "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git" } ], "require": { "GIT_USER_ID/GIT_REPO_ID": "*@dev" } }
然后运行 composer install
手动安装
下载文件并包含 autoload.php
<?php require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');
入门指南
请遵循安装步骤,然后运行以下命令
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: apiKey $config = ProductApi\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = ProductApi\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); $apiInstance = new ProductApi\Api\CategoriesApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client(), $config ); $page = 1; // int | The collection page number try { $result = $apiInstance->getCategoriesCollection($page); print_r($result); } catch (Exception $e) { echo 'Exception when calling CategoriesApi->getCategoriesCollection: ', $e->getMessage(), PHP_EOL; }
API 端点
所有URI均相对于https://
模型
- CategoriesRead
- CategoriesWrite
- CharacteristicRead
- CharacteristicWrite
- Credentials
- ProductTypeRead
- ProductTypeWrite
- ProductsRead
- ProductsWrite
- RefreshToken
- Token
- UserUserRead
- UserUserWrite
授权
apiKey
- 类型: API密钥
- API密钥参数名: 授权
- 位置: HTTP头部
测试
要运行测试,请使用
composer install vendor/bin/phpunit
作者
关于此包
此PHP包由OpenAPI Generator项目自动生成
- API版本:
0.0.0
- 构建包:
org.openapitools.codegen.languages.PhpClientCodegen