macropage/sdk-ebay-rest-browse

<p>浏览API具有以下资源:</p> <ul> <li><b>item_summary: </b> 允许购物者通过关键词、GTIN、类别、慈善机构、产品或项目方面等搜索特定项目,并通过使用过滤器来细化结果。</li> <li> <a href="https://developer.ebay.com/api-docs/static/versioning

dev-master 2019-03-12 17:11 UTC

This package is auto-updated.

Last update: 2024-09-08 00:32:06 UTC


README

浏览API具有以下资源

  • item_summary: 允许购物者通过关键词、GTIN、类别、慈善机构、产品或项目方面等搜索特定项目,并通过使用过滤器来细化结果。
  • "Experimental" title= (实验性) search_by_image: 允许购物者通过图像搜索特定项目。您可以通过URI参数和过滤器来细化结果。
  • item: 允许您检索特定项目的详细信息或项目组的所有项目,项目组是一个具有如颜色和尺寸等变化的项目。此资源还提供了 eBay 旧版 API(如 TradingFinding)与 RESTful API(如 Browse)之间的桥梁,后者使用不同的项目 ID 格式。您可以使用 Browse API 使用旧版项目 ID 获取项目的详细信息和使用 RESTful 项目 ID。您可以使用 Browse API 使用旧版项目 ID 获取项目的详细信息和使用 RESTful 项目 ID。
  • "Experimental" title= (实验性) shopping_cart: 提供了 eBay 成员查看其 eBay 购物车内容、添加、删除和更改其 eBay 购物车中项目数量的功能。  注意: 此资源在 eBay API 探索器中不可用。

item_summarysearch_by_imageitem 资源调用需要 应用程序访问令牌shopping_cart 资源调用需要 用户访问令牌

此 PHP 软件包由 OpenAPI Generator 项目自动生成

  • API 版本:v1_beta.19.0
  • 软件包版本:2.3.2
  • 构建软件包:org.openapitools.codegen.languages.PhpClientCodegen

需求

PHP 5.5 及更高版本

安装与使用

Composer

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

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

然后运行 composer install

手动安装

下载文件并包含 autoload.php

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

测试

要运行单元测试

composer install
./vendor/bin/phpunit

入门

请遵循 安装程序,然后运行以下内容

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

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

$apiInstance = new macropage\SDKs\ebay\rest\browse\Api\ItemApi(
    // 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
);
$itemId = 'itemId_example'; // string | The eBay RESTful identifier of an item (such as a part you want to check). This ID is returned by the Browse and Feed API methods. RESTful Item ID Format: v1|#|# For example: v1|272394640372|0 or v1|162846450672|461882996982 For more information about item ID for RESTful APIs, see the Legacy API compatibility section of the Buy APIs Overview.
$xEBAYCMARKETPLACEID = 'xEBAYCMARKETPLACEID_example'; // string | The ID of the eBay marketplace you want to use. Note: This value is case sensitive. For example: &nbsp;&nbsp;X-EBAY-C-MARKETPLACE-ID = EBAY_US For a list of supported sites see, API Restrictions.
$compatibilityPayload = new \macropage\SDKs\ebay\rest\browse\Model\CompatibilityPayload(); // \macropage\SDKs\ebay\rest\browse\Model\CompatibilityPayload | 

try {
    $result = $apiInstance->checkCompatibility($itemId, $xEBAYCMARKETPLACEID, $compatibilityPayload);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ItemApi->checkCompatibility: ', $e->getMessage(), PHP_EOL;
}

?>

API 端点文档

所有 URI 都相对于 https://api.ebay.com/buy/browse/v1

模型文档

授权文档

api_auth

bearerAuth

  • 类型: HTTP基本认证

作者