我正在尝试为ebay创建url请求以获取项目规范 像屏幕大小,CPU等。 试图查看ebay文档,但没有找到如何做到这一点,
希望你能帮忙!
谢谢!
答案 0 :(得分:0)
在不查看您的代码的情况下,我只能建议您使用所有活动项目以及所有详细信息:
$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>ReturnAll</DetailLevel>
<MessageID>1</MessageID>
<Version>$eBay->api_version</Version>
<WarningLevel>High</WarningLevel>
</GetMyeBaySellingRequest>
EOD;
$feed = trim($feed);
$site_id = 3;//3 For UK
$headers = array
(
'X-EBAY-API-COMPATIBILITY-LEVEL: ' . $this->api_version,
'X-EBAY-API-DEV-NAME: ' . $this->dev_id,
'X-EBAY-API-APP-NAME: ' . $this->app_id,
'X-EBAY-API-CERT-NAME: ' . $this->cert_id,
'X-EBAY-API-CALL-NAME: ' . $call_name,
'X-EBAY-API-SITEID: ' . $site_id,
);
// Send request to eBay and load response in $response
$connection = curl_init();
curl_setopt($connection, CURLOPT_URL, $this->api_endpoint);
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);
答案 1 :(得分:0)
GetItem
正是您要找的,IncludeItemSpecifics
设置为true
。
或者,使用来自Shopping API的GetSingleItem
进行较轻的API调用,IncludeSelector
设置为ItemSpecifics
。