基于EBay的API文档: https://developer.ebay.com/devzone/merchandising/docs/CallRef/getMostWatchedItems.html
我打了以下电话:
<?xml version="1.0" encoding="UTF-8"?>
<getMostWatchedItems xmlns="http://www.ebay.com/marketplace/services">
<maxResults>3</maxResults>
</getMostWatchedItems>
具有以下标题:
X-EBAY-API-COMPATIBILITY-LEVEL 967
X-EBAY-API-CALL-NAME getMostWatchedItems
X-EBAY-API-SITEID 15
Content-Type text/xml
但是它返回以下响应:
<?xml version="1.0" encoding="UTF-8" ?>
<eBay>
<EBayTime>2018-11-09 03:20:27</EBayTime>
<Errors>
<Error>
<Code>2</Code>
<ErrorClass>RequestError</ErrorClass>
<SeverityCode>1</SeverityCode>
<Severity>SeriousError</Severity>
<Line>0</Line>
<Column>0</Column>
<ShortMessage>
<![CDATA[ Unsupported verb. ]]>
</ShortMessage>
</Error>
</Errors>
</eBay>
有人遇到相同的问题吗?感谢您的帮助。
答案 0 :(得分:1)
<?xml version="1.0" encoding="UTF-8" ?>
<getMostWatchedItemsResponse xmlns="urn:ebay:apis:eBLBaseComponents">
<Timestamp>2018-11-09 18:23:12</Timestamp>
<Ack>Failure</Ack>
<Errors>
<ShortMessage>Unsupported API call.</ShortMessage>
<LongMessage>The API call "getMostWatchedItems" is invalid or not supported in this release.</LongMessage>
<ErrorCode>2</ErrorCode>
<SeverityCode>Error</SeverityCode>
<ErrorClassification>RequestError</ErrorClassification>
</Errors>
<Version>967</Version>
<Build>18863825</Build>
</getMostWatchedItemsResponse>
似乎967版本的eBay API不支持getMostWatchedItems。
答案 1 :(得分:0)
您没有使用正确的标题。您的标头看起来像是购物API的标题,该调用(gMWI)不在其中。
对于1件事,您没有在gMWI中使用SiteID。您使用全局ID。
请查看this Merchandising API tutorial,尤其是“标准标题”部分。