cdma-numiscorner / ebay-taxonomy-api
使用分类API来发现最合适的eBay类别,卖家可以在这些类别下出售库存商品,以及买家浏览或搜索购买商品最有可能的类别。此外,分类API还提供了有关所需和推荐类别属性元数据的信息,并提供两个操作来检索零件兼容性信息。
1.0
2024-07-03 12:46 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
This package is auto-updated.
Last update: 2024-09-03 13:18:08 UTC
README
使用分类API来发现最合适的eBay类别,卖家可以在这些类别下出售库存商品,以及买家浏览或搜索购买商品最有可能的类别。此外,分类API还提供了有关所需和推荐类别属性元数据的信息,并提供两个操作来检索零件兼容性信息。
安装与使用
需求
PHP 7.2及更高版本。
Composer
从openApi规范中重新生成客户端
docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli:v5.0.1 generate -i https://developer.ebay.com/api-docs/master/commerce/taxonomy/openapi/3/commerce_taxonomy_v1_oas3.json -g php --git-user-id cdma-numiscorner --git-host github.com --git-repo-id ebay-taxonomy-api --invoker-package 'OpenAPI\EbayTaxonomyApiClient' --artifact-version 1.0 -o /local
要通过Composer安装绑定,请将以下内容添加到composer.json
{ "repositories": [ { "type": "vcs", "url": "https://github.com/cdma-numiscorner/ebay-taxonomy-api.git" } ], "require": { "cdma-numiscorner/ebay-taxonomy-api": "*@dev" } }
然后运行composer install
手动安装
下载文件并包含autoload.php
<?php require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');
入门
请遵循安装过程,然后运行以下命令
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure OAuth2 access token for authorization: api_auth $config = OpenAPI\EbayTaxonomyApiClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new OpenAPI\EbayTaxonomyApiClient\Api\CategoryTreeApi( // 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 ); $category_tree_id = 'category_tree_id_example'; // string | The unique identifier of the eBay category tree. The category tree ID for an eBay marketplace can be retrieved using the <b>getDefaultCategoryTreeId</b> method. try { $result = $apiInstance->fetchItemAspects($category_tree_id); print_r($result); } catch (Exception $e) { echo 'Exception when calling CategoryTreeApi->fetchItemAspects: ', $e->getMessage(), PHP_EOL; }
API端点
所有URI均相对于https://api.ebay.com/commerce/taxonomy/v1
模型
- AncestorReference
- Aspect
- AspectConstraint
- AspectMetadata
- AspectValue
- BaseCategoryTree
- Category
- CategoryAspect
- CategorySubtree
- CategorySuggestion
- CategorySuggestionResponse
- CategoryTree
- CategoryTreeNode
- CompatibilityProperty
- CompatibilityPropertyValue
- Error
- ErrorParameter
- GetCategoriesAspectResponse
- GetCompatibilityMetadataResponse
- GetCompatibilityPropertyValuesResponse
- RelevanceIndicator
- ValueConstraint
授权
api_auth
- 类型:
OAuth
- 流程:
application
- 授权URL: ``
- 作用域:
- https://api.ebay.com/oauth/api_scope: 查看eBay的公共数据
- https://api.ebay.com/oauth/api_scope/metadata.insights: 查看元数据洞察,如属性相关性。
测试
要运行测试,请使用
composer install vendor/bin/phpunit
作者
关于此包
此PHP包由OpenAPI Generator项目自动生成
- API版本:
v1.0.1
- 包版本:
1.0
- 包版本:
- 构建包:
org.openapitools.codegen.languages.PhpClientCodegen