PHP code example of nogrod / ebay-sell-metadata-php-sdk

1. Go to this page and download the library: Download nogrod/ebay-sell-metadata-php-sdk 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/ */

    

nogrod / ebay-sell-metadata-php-sdk example snippets





 Configure OAuth2 access token for authorization: api_auth
$config = eBay\Sell\Metadata\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Configure OAuth2 access token for authorization: api_auth
$config = eBay\Sell\Metadata\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new eBay\Sell\Metadata\Api\CompatibilitiesApi(
    // 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
);
$x_ebay_c_marketplace_id = 'x_ebay_c_marketplace_id_example'; // string | This header identifies the seller's eBay marketplace.<br><br>See <a href=\"/develop/api/sell/request_headers#marketplace-id-values\" target=\"_blank \">Marketplace ID values</a> for a list of supported eBay marketplace ID values.
$specification_request = new \eBay\Sell\Metadata\Model\SpecificationRequest(); // \eBay\Sell\Metadata\Model\SpecificationRequest | This type defines the properties and specifications to use to search for compatibilities.

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

json
{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/nogrod/ebay-sell-metadata-php-sdk.git"
    }
  ],
  "