PHP code example of cdma-numiscorner / ebay-metadata-sdk

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

    

cdma-numiscorner / ebay-metadata-sdk example snippets





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

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


$apiInstance = new OpenAPI\EbayMetadataClient\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.
$content_type = 'content_type_example'; // string | This header indicates the format of the request body provided by the client.<br><br>Its value should be set to <code>application/json</code>.<br><br>For more information, refer to <a href=\"/develop/api/sell/request_headers\" target=\"_blank \">Request Headers</a>.
$specification_request = new \OpenAPI\EbayMetadataClient\Model\SpecificationRequest(); // \OpenAPI\EbayMetadataClient\Model\SpecificationRequest | This type defines the properties and specifications to use to search for compatibilities.

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