Example

Example – Basic example of Services_Ebay

Basic example of Services_Ebay

The following examples show how to use some basic features of Services_Ebay:

Using a proxy object

<?php
require_once 'Services/Ebay.php';
    
// pass some authentication data
$session Services_Ebay::getSession($devId$appId$certId);
$session->setToken($token);

// create new proxy object
$ebay = new Services_Ebay($session);

// call a method
echo $ebay->GeteBayOfficialTime();
?>

Working directly with a Call object

<?php
require_once 'Services/Ebay.php';

// pass some authentication data
$session Services_Ebay::getSession($devId$appId$certId);
$session->setToken($token);

$call Services_Ebay::loadAPICall('GetEbayOfficialTime');
$result $call->call($session);

echo 
$result;
?>

Using the model classes

<?php
require_once 'Services/Ebay.php';

// pass some authentication data
$session Services_Ebay::getSession($devId$appId$certId);
$session->setToken($token);

// get an eBay item
$item $ebay->GetItem(45013331792);

// The Seller property is an object as well
echo 'User-Id of the seller: '.$item->Seller->UserId.'<br />';

// convert the item to an array 
echo '<pre>';
print_r($item->toArray());
echo 
'</pre>';

// Use methods of the model
$item->AddToDescription('I forgot some important information');

// Change the item
$item->Title 'The new title of the item';

$ebay->ReviseItem($item);
?>
The architecture of Services_Ebay (Previous) Services_GeoNames (Next)
Last updated: Sat, 16 Feb 2019 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report.
View this page in:
  • English

User Notes:

There are no user contributed notes for this page.