ebay发现api通话不起作用

时间:2015-01-26 01:26:45

标签: javascript xml api call ebay

我试图打电话给ebay在网址栏中通过GET查找api,我收到了这些错误(XML):

<errorMessage xmlns="http://www.ebay.com/marketplace/search/v1/services">
<error>
<errorId>2033</errorId>
<domain>CoreRuntime</domain>
<severity>Error</severity>
<category>Request</category>
<message>
Input URL gave a value for header X-EBAY-SOA-OPERATION-NAME equal to findItemsByKeywords but has a conflicting mapped value, findItemsByKeywords
</message>
<subdomain>Inbound_Meta_Data</subdomain>
<parameter name="Param1">X-EBAY-SOA-OPERATION-NAME</parameter>
<parameter name="Param2">findItemsByKeywords</parameter>
<parameter name="Param3">findItemsByKeywords</parameter>
</error>
<error>
<errorId>2010</errorId>
<domain>CoreRuntime</domain>
<severity>Error</severity>
<category>Request</category>
<message>Unknown response payload type XML</message>
<subdomain>Inbound_Meta_Data</subdomain>
<parameter name="Param1">XML</parameter>
</error>
<error>
<errorId>2021</errorId>
<domain>CoreRuntime</domain>
<severity>Error</severity>
<category>Request</category>
<message>Invalid version format 1.13.0</message>
<subdomain>Inbound_Meta_Data</subdomain>
<parameter name="Param1">1.13.0</parameter>
</error>
</errorMessage>

这是我的网址:

http://svcs.ebay.com/services/search/FindingService/v1?OPERATION-NAME=findItemsByKeywords
   &SERVICE-VERSION=1.0.0
   &SECURITY-APPNAME=YourAppID
   &RESPONSE-DATA-FORMAT=XML
   &REST-PAYLOAD
   &keywords=harry%20potter%20phoenix

我已经在ebay developer api上注册了,上面的url直接来自他们的文档:

http://developer.ebay.com/Devzone/finding/Concepts/MakingACall.html#syntax

我已经将YourAppID替换为我自己的,而不是在此代码中。

2 个答案:

答案 0 :(得分:2)

可能只是在URL中偶然出现了一些空格。像这样的小问题会产生令人眼花缭乱的API错误。

同时使用1.12.0及其左右的&amp; SERVICE-VERSION。 1.0.0有点老了。

答案 1 :(得分:1)

您还需要在请求中包含SERVICE-NAME:

http://svcs.ebay.com/services/search/FindingService/v1?
    OPERATION-NAME=findItemsByKeywords&
    SERVICE-NAME=FindingService&
    SERVICE-VERSION=1.0.0&
    SECURITY-APPNAME=YourAppId4&
    RESPONSE-DATA-FORMAT=XML&
    REST-PAYLOAD&keywords=harry%20potter%20phoenix