eBay Finding API findItemsByKeywords returns '

2019-07-31 15:01发布

问题:

I'm trying to make a call in to eBay's Finding API via GET in the URL bar, and i get these errors(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>

Here is my url:

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

I have already registered with eBay developer API, and the above URL is directly from their documentation.

And I have replaced the YourAppID with my own on my end not in this code.

回答1:

It might simply be that you have some spaces accidentally in the URL. Small problems like that can generate dizzying API errors.

Also use a &SERVICE-VERSION of 1.12.0 or thereabouts. 1.0.0 is a bit old.



回答2:

You need to include the SERVICE-NAME in your request as well:

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