macropage / sdk-ebay-rest-media
媒体API允许卖家创建、上传和获取视频。
dev-master
2022-02-11 17:57 UTC
Requires
- php: ^7.3 || ^8.0
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^7.3
- guzzlehttp/psr7: ^1.7 || ^2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.12
- phpunit/phpunit: ^8.0 || ^9.0
This package is auto-updated.
Last update: 2024-09-14 21:21:07 UTC
README
媒体API允许卖家创建、上传和获取视频。
安装与使用
要求
PHP 7.3及更高版本。也应适用于PHP 8.0,但尚未测试。
Composer
要使用Composer安装绑定,请将以下内容添加到composer.json
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/macropage/sdk-ebay-rest-media.git"
}
],
"require": {
"macropage/sdk-ebay-rest-media": "*@dev"
}
}
然后运行composer install
手动安装
下载文件并包含autoload.php
<?php require_once('/path/to/sdk-ebay-rest-media/vendor/autoload.php');
入门指南
请遵循安装过程,然后运行以下操作
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure OAuth2 access token for authorization: Authorization Code $config = macropage\SDKs\ebay\rest\media\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new macropage\SDKs\ebay\rest\media\Api\VideoApi( // 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 ); $body = new \macropage\SDKs\ebay\rest\media\Model\CreateVideoRequest(); // \macropage\SDKs\ebay\rest\media\Model\CreateVideoRequest try { $apiInstance->createVideo($body); } catch (Exception $e) { echo 'Exception when calling VideoApi->createVideo: ', $e->getMessage(), PHP_EOL; }
API端点
所有URI相对于https://apim.ebay.com/commerce/media/v1_beta
模型
授权
授权码
- 类型:
OAuth - 流程:
accessCode - 授权URL:
https://auth.ebay.com/oauth2/authorize - 作用域:
- https://api.ebay.com/oauth/api_scope/sell.inventory: 查看和管理您的库存和报价
测试
要运行测试,请使用
composer install vendor/bin/phpunit
作者
关于此包
此PHP包由OpenAPI Generator项目自动生成
- API版本:
v1_beta.1.0- 包版本:
2.3.2
- 包版本:
- 构建包:
org.openapitools.codegen.languages.PhpClientCodegen