2

How can I connect api with websites?

I am new to the eBay API and currently developing in PHP, I have managed to use GetItem to import details of an order based on the Item ID to my website's database. But What I want to do now is to link a users account to my website and import their listings to my database. I have put the code I used for GetItem (below) but now I am stuck and I don't know what to use, GetAccount, GetUser or GetSellerList.

1

3 Answers 3

0

if you want all items of a user and you have access to his auth token you could use the getMyEbaySelling call that will return you all items of the user.

(explainations + examples can be found here: Can I edit A third party ebay seller's item from his seller list by API?)

if you want to retrieve items from "3rd party" users from which you only have the user/account name you will need to go with the getSellerListing call can retrieve items listed by this seller. (executeable example here: https://ebay-sdk.intradesys.com/s/c0c7c76d30bd3dcaefc96f40275bdc0a)

depending on what you want to display on your website you will need to see if those informations are already contained within the response or you will need to call the getItem call for each item to retrieve additional informations that are missing

0

Here you go Arjun

eBay returns 200 items in one page for one api call

$feed = <<< EOD
<?xml version="1.0" encoding="utf-8"?>
<GetMyeBaySellingRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>
<eBayAuthToken>$auth_token</eBayAuthToken>
</RequesterCredentials>
<ActiveList>
<Sort>Title</Sort>
<IncludeNotes>FALSE</IncludeNotes>
<Pagination><EntriesPerPage>200</EntriesPerPage>
<PageNumber>$pageNo</PageNumber>
</Pagination>
</ActiveList>
<HideVariations>FALSE</HideVariations>
<DetailLevel>ReturnAll</DetailLevel>
<MessageID>1</MessageID>
<Version>899</Version>
<WarningLevel>High</WarningLevel>
</GetMyeBaySellingRequest>​
EOD;


$feed = trim($feed);
$headers = array
(
'X-EBAY-API-COMPATIBILITY-LEVEL: 899',
    'X-EBAY-API-DEV-NAME: ' . $dev_id,
    'X-EBAY-API-APP-NAME: ' . $app_id,
    'X-EBAY-API-CERT-NAME: ' . $cert_id,
    'X-EBAY-API-CALL-NAME: GetMyeBaySelling',
    'X-EBAY-API-SITEID: 3'//3 For UK
);

// Send request to eBay and load response in $response
$connection = curl_init();
curl_setopt($connection, CURLOPT_URL, "https://api.ebay.com/ws/api.dll");
curl_setopt($connection, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($connection, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($connection, CURLOPT_HTTPHEADER, $headers);
curl_setopt($connection, CURLOPT_POST, 1);
curl_setopt($connection, CURLOPT_POSTFIELDS, $feed);
curl_setopt($connection, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($connection);
curl_close($connection);

$xml = simplexml_load_string($response);
...
...
?>
0

I would also take a look at the difference between getsellerlist and getmyebayselling. I do not think getmyebayselling can retrieve things like the users store categories, but getsellerlist can.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.