https://github.com/michabbb/sdk-ebay-rest-media
A PHP SDK for the eBay Media Rest API
https://github.com/michabbb/sdk-ebay-rest-media
ebay php rest sdk
Last synced: 3 months ago
JSON representation
A PHP SDK for the eBay Media Rest API
- Host: GitHub
- URL: https://github.com/michabbb/sdk-ebay-rest-media
- Owner: michabbb
- Created: 2022-02-11T17:56:43.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-02-11T17:57:33.000Z (over 3 years ago)
- Last Synced: 2024-03-15T01:52:23.962Z (about 1 year ago)
- Topics: ebay, php, rest, sdk
- Language: PHP
- Homepage: https://developer.ebay.com/api-docs/commerce/media/overview.html
- Size: 35.2 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# sdk-ebay-rest-media
The Media API lets sellers to create, upload, and retrieve files, including:
- videos
- documents (for GPSR regulations)
## Installation & Usage
### Requirements
PHP 7.3 and later.
Should also work with PHP 8.0 but has not been tested.
### Composer
To install the bindings via [Composer](https://getcomposer.org/), add the following to `composer.json`:
```json
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/macropage/sdk-ebay-rest-media.git"
}
],
"require": {
"macropage/sdk-ebay-rest-media": "*@dev"
}
}
```
Then run `composer install`
### Manual Installation
Download the files and include `autoload.php`:
```php
setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new macropage\SDKs\ebay\rest\media\Api\DocumentApi(
// 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
);
$contentType = 'contentType_example'; // string | This header indicates the format of the request body provided by the client. Its value should be set to application/json.
For more information, refer to HTTP request headers.
$createDocumentRequest = new \macropage\SDKs\ebay\rest\media\Model\CreateDocumentRequest(); // \macropage\SDKs\ebay\rest\media\Model\CreateDocumentRequest
try {
$result = $apiInstance->createDocument($contentType, $createDocumentRequest);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DocumentApi->createDocument: ', $e->getMessage(), PHP_EOL;
}
```
## API Endpoints
All URIs are relative to *https://apim.ebay.com/commerce/media/v1_beta*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*DocumentApi* | [**createDocument**](docs/Api/DocumentApi.md#createdocument) | **POST** /document |
*DocumentApi* | [**getDocument**](docs/Api/DocumentApi.md#getdocument) | **GET** /document/{document_id} |
*DocumentApi* | [**uploadDocument**](docs/Api/DocumentApi.md#uploaddocument) | **POST** /document/{document_id}/upload |
*VideoApi* | [**createVideo**](docs/Api/VideoApi.md#createvideo) | **POST** /video |
*VideoApi* | [**getVideo**](docs/Api/VideoApi.md#getvideo) | **GET** /video/{video_id} |
*VideoApi* | [**uploadVideo**](docs/Api/VideoApi.md#uploadvideo) | **POST** /video/{video_id}/upload |
## Models
- [CreateDocumentRequest](docs/Model/CreateDocumentRequest.md)
- [CreateDocumentResponse](docs/Model/CreateDocumentResponse.md)
- [CreateVideoRequest](docs/Model/CreateVideoRequest.md)
- [DocumentMetadata](docs/Model/DocumentMetadata.md)
- [DocumentResponse](docs/Model/DocumentResponse.md)
- [Error](docs/Model/Error.md)
- [ErrorParameter](docs/Model/ErrorParameter.md)
- [Image](docs/Model/Image.md)
- [Moderation](docs/Model/Moderation.md)
- [Play](docs/Model/Play.md)
- [Video](docs/Model/Video.md)
## Authorization
### api_auth
- **Type**: `OAuth`
- **Flow**: `accessCode`
- **Authorization URL**: `https://auth.ebay.com/oauth2/authorize`
- **Scopes**:
- **https://api.ebay.com/oauth/api_scope/sell.inventory**: View and manage your inventory and offers
## Tests
To run the tests, use:
```bash
composer install
vendor/bin/phpunit
```
## Author
## About this package
This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
- API version: `v1_beta.2.0`
- Package version: `2.3.2`
- Build package: `org.openapitools.codegen.languages.PhpClientCodegen`