zvps/ebay-sell-feed-php-client

Feed API 允许卖家上传输入文件,下载包括状态在内的报告和文件,使用 URI 参数过滤报告,并检索客户服务指标任务详情。

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

This package is auto-updated.

Last update: 2024-09-29 06:25:45 UTC


README

Feed API 允许卖家上传输入文件,下载包括状态在内的报告和文件,使用 URI 参数过滤报告,并检索客户服务指标任务详情。

安装与使用

要求

PHP 7.2 及以上版本。

Composer

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

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github/zvps/ebay-sell-feed-php-client.git"
    }
  ],
  "require": {
    "zvps/ebay-sell-feed-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\Feed\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Ebay\Sell\Feed\Api\CustomerServiceMetricTaskApi(
    // 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
);
$accept_language = 'accept_language_example'; // string | Use this header to specify the natural language in which the authenticated user desires the response.
$body = new \Ebay\Sell\Feed\Model\CreateServiceMetricsTaskRequest(); // \Ebay\Sell\Feed\Model\CreateServiceMetricsTaskRequest | Request payload containing version, feedType, and optional filterCriteria.

try {
    $apiInstance->createCustomerServiceMetricTask($accept_language, $body);
} catch (Exception $e) {
    echo 'Exception when calling CustomerServiceMetricTaskApi->createCustomerServiceMetricTask: ', $e->getMessage(), PHP_EOL;
}

API 端点

所有 URI 都相对于 https://api.ebay.com/sell/feed/v1

模型

授权

授权代码

测试

要运行测试,使用

composer install
vendor/bin/phpunit

作者

关于此包

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

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