minotaurlogistics/ebay-identity-api

1.0 2021-03-22 08:43 UTC

This package is auto-updated.

Last update: 2024-09-22 16:42:03 UTC


README

Build Status

SwaggerClient-php

检索认证用户的账户配置信息。它可以用来让用户通过eBay登录您的应用或网站,从而让您无需存储和保护用户的PII(个人信息)数据。

此PHP包由Swagger Codegen项目自动生成

  • API版本:v1.0.0
  • 包版本:1.0
  • 构建包:io.swagger.codegen.languages.PhpClientCodegen

要求

PHP 5.5及更高版本

安装与使用

Composer

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

{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/minotaurlogistics/ebay-identity-api.git"
    }
  ],
  "require": {
    "minotaurlogistics/ebay-identity-api": "*@dev"
  }
}

然后运行composer install

手动安装

下载文件并包含autoload.php

    require_once('/path/to/SwaggerClient-php/vendor/autoload.php');

测试

要运行单元测试

composer install
./vendor/bin/phpunit

生成客户端

docker run --rm -v ${PWD}:/codegen/SwaggerClient-php swaggerapi/swagger-codegen-cli generate \
-i https://developer.ebay.com/api-docs/master/commerce/identity/openapi/2/commerce_identity_v1_oas2.json \ 
-o /codegen \
-l php \
--git-user-id minotaurlogistics --git-repo-id ebay-identity-api \
--invoker-package 'Swagger\EbayIdentityClient' \
--artifact-version 1.0 \
--api-package 'GeneratedApi'

入门指南

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

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

// Configure OAuth2 access token for authorization: Authorization Code
$config = Swagger\EbayIdentityClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new Swagger\EbayIdentityClient\Api\UserApi(
    // 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
);

try {
    $result = $apiInstance->getUser();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling UserApi->getUser: ', $e->getMessage(), PHP_EOL;
}

?>

API端点文档

所有URI均相对于https://apiz.ebay.com/commerce/identity/v1

模型文档

授权文档

授权码

作者