zvps/ebay-sell-recommendation-php-client

推荐API返回卖家可以用来优化他们在eBay上列表配置的信息。目前,API包含一个方法,findListingRecommendations。该方法提供卖家可以用来配置推广列表广告活动以最大化其在eBay市场中的商品可见性的信息。

dev-main 2021-07-30 16:32 UTC

This package is auto-updated.

Last update: 2024-09-29 05:49:58 UTC


README

推荐API返回卖家可以用来优化他们在eBay上列表配置的信息。目前,该API包含一个方法,findListingRecommendations。该方法提供卖家可以用来配置推广列表广告活动以最大化其在eBay市场中的商品可见性的信息。

安装与使用

要求

PHP 7.2及更高版本。

Composer

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

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github/zvps/ebay-sell-recommendation-php-client.git"
    }
  ],
  "require": {
    "zvps/ebay-sell-recommendation-php-client": "*@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: Authorization Code
$config = Ebay\Sell\Recommendation\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Ebay\Sell\Recommendation\Api\ListingRecommendationApi(
    // 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
);
$x_ebay_c_marketplace_id = 'x_ebay_c_marketplace_id_example'; // string | Use this header to specify the eBay marketplace where you list the items for which you want to get recommendations.
$filter = 'filter_example'; // string | Provide a list of key-value pairs to specify the criteria you want to use to filter the response. In the list, separate each filter key from its associated value with a colon (&quot;:&quot;). Currently, the only supported filter value is recommendationTypes and it supports only the (&quot;AD&quot;) type. Follow the recommendationTypes specifier with the filter type(s) enclosed in curly braces (&quot;{ }&quot;), and separate multiple types with commas. Example: filter=recommendationTypes:{AD} Default: recommendationTypes:{AD}
$limit = 56; // int | Use this query parameter to set the maximum number of ads to return on a page from the paginated response. Default: 10 Maximum: 500
$offset = 56; // int | Specifies the number of ads to skip in the result set before returning the first ad in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0
$body = new \Ebay\Sell\Recommendation\Model\FindListingRecommendationRequest(); // \Ebay\Sell\Recommendation\Model\FindListingRecommendationRequest

try {
    $result = $apiInstance->findListingRecommendations($x_ebay_c_marketplace_id, $filter, $limit, $offset, $body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ListingRecommendationApi->findListingRecommendations: ', $e->getMessage(), PHP_EOL;
}

API端点

所有URI均相对于https://api.ebay.com/sell/recommendation/v1

模型

授权

授权代码

测试

要运行测试,请使用

composer install
vendor/bin/phpunit

作者

关于此包

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

  • API版本: 1.1.0
    • 包版本: 5.0.0
  • 构建包: org.openapitools.codegen.languages.PhpClientCodegen