例如,我有一堆ebay项ID,我需要检索所有列表的数据,包括细节字段。怎么能完成这样的任务?
我发现,ebay api有一个' GetMultipleItems' Trading API的操作,但已被弃用。现在只有Shopping API有这样的操作,但问题是Shopping API使用'有效负载' ebay有时回答。
感谢。
答案 0 :(得分:1)
您可以使用GetItemRequest通过提供item_id
来获取商品的详细信息e.g。
$feed = <<< EOD
<?xml version="1.0" encoding="utf-8"?>
<GetItemRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>
<eBayAuthToken>$eBay_auth_token</eBayAuthToken>
</RequesterCredentials>
<ItemID>$itemid</ItemID>
<IncludeItemSpecifics>true</IncludeItemSpecifics>
<DetailLevel>ItemReturnAttributes</DetailLevel>
<ErrorLanguage>en_GB</ErrorLanguage>
<MessageID>$message_id</MessageID>
<Version>$api_version</Version>
<WarningLevel>High</WarningLevel>
</GetItemRequest>
EOD;
$response = $eBay->InitCurl($feed, "GetItem");
$xml = simplexml_load_string($response);
另请参阅此eBay Doc
或尝试GetMyeBaySelling,在一次通话中获得200件物品
$feed = <<< EOD
<?xml version="1.0" encoding="utf-8"?>
<GetMyeBaySellingRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>
<eBayAuthToken>$eBay->auth_token</eBayAuthToken>
</RequesterCredentials>
<ActiveList>
<Sort>Title</Sort>
<IncludeNotes>FALSE</IncludeNotes>
<Pagination><EntriesPerPage>200</EntriesPerPage>
<PageNumber>$pageNo</PageNumber>
</Pagination>
</ActiveList>
<HideVariations>FALSE</HideVariations>
<DetailLevel>ReturnSummary</DetailLevel>
<MessageID>1</MessageID>
<Version>$eBay->api_version</Version>
<WarningLevel>High</WarningLevel>
</GetMyeBaySellingRequest>
EOD;
$response = $eBay->InitCurl($feed, "GetMyeBaySelling");
$xml = simplexml_load_string($response);
http://developer.ebay.com/DevZone/XML/docs/Reference/eBay/GetMyeBaySelling.html