macropage/sdk-ebay-rest-taxonomy

使用分类API来发现最合适的eBay类别,卖家可以在这些类别下提供库存商品进行销售,以及买家浏览或搜索商品购买的最可能类别。此外,分类API还提供有关所需和推荐类别属性(包括在列表中)的元数据,并且有两个操作来检索零件兼容性信息。

dev-master 2023-02-20 22:01 UTC

This package is auto-updated.

Last update: 2024-09-21 01:27:22 UTC


README

使用分类API来发现最合适的eBay类别,卖家可以在这些类别下提供库存商品进行销售,以及买家浏览或搜索商品购买的最可能类别。此外,分类API还提供有关所需和推荐类别属性(包括在列表中)的元数据,并且有两个操作来检索零件兼容性信息。

安装与使用

要求

PHP 7.4及更高版本。也应与PHP 8.0兼容。

Composer

要通过Composer安装绑定,请将以下内容添加到composer.json

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/macropage/sdk-ebay-rest-taxonomy.git"
    }
  ],
  "require": {
    "macropage/sdk-ebay-rest-taxonomy": "*@dev"
  }
}

然后运行composer install

手动安装

下载文件并包含autoload.php

<?php
require_once('/path/to/sdk-ebay-rest-taxonomy/vendor/autoload.php');

入门

请按照安装过程进行操作,然后运行以下命令

<?php
require_once(__DIR__ . '/vendor/autoload.php');



// Configure OAuth2 access token for authorization: api_auth
$config = macropage\SDKs\ebay\rest\taxonomy\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new macropage\SDKs\ebay\rest\taxonomy\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
);
$categoryTreeId = 'categoryTreeId_example'; // string | The unique identifier of the eBay category tree being requested.

try {
    $result = $apiInstance->fetchItemAspects($categoryTreeId);
    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

模型

授权

api_auth

测试

要运行测试,请使用

composer install
vendor/bin/phpunit

作者

关于此包

此PHP包是由OpenAPI Generator项目自动生成的

  • API版本: v1.0.0
    • 包版本: 2.3.2
  • 构建包: org.openapitools.codegen.languages.PhpClientCodegen