PHP code example of macropage / sdk-ebay-rest-media
1. Go to this page and download the library: Download macropage/sdk-ebay-rest-media library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
macropage / sdk-ebay-rest-media example snippets
Configure OAuth2 access token for authorization: api_auth
$config = macropage\SDKs\ebay\rest\media\Configuration::getDefaultConfiguration()->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 <b>application/json</b>. <br><br> For more information, refer to <a href=\"/api-docs/static/rest-request-components.html#HTTP\" target=\"_blank \">HTTP request headers</a>.
$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;
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.