12-16-2019 06:27 AM
Hallo, i'm new to the ebay api and am working on getting api calls to work. I assume to have done everything required according to the documentation, but still the XML interface only works for one single call (getItem) for me, but not for any of the other listing/finding calls i have tried. On the other hand, when i put the exact same parameters in URL-parameters for the finding API calls, it works.
While i could get away with the matter by switching over to URL-GET-parameters for the finding API, that does not apply to the Trading API. So i have to figure out the reason for the discrepancy anyways.
I am working with both the "Trading" and "Finding" API. I am using simple reading calls for the beginning to avoid as much trouble as possible. Thus, i am trying to list the products of my customer via the Trading API with GetSellerList and via the Finding API with findItemsIneBayStores and findItemsAdvanced or to read single Items with GetItem.
What worked so far are GetItem via XML Interface and findItemsAdvanced via URL-Parameterlist-Interface. Since findItemsAdvanced can be called in both modes (XML and URL-Parameterlist) and is working in one of them, i would like to solve the issue with that particular call.
This is my working call with URL Parameters:
$url = 'http://svcs.ebay.com/services/search/FindingService/v1'. '?SECURITY-APPNAME=CPO...'. '&OPERATION-NAME=findItemsAdvanced'. '&SERVICE-VERSION=1.13.0'. '&RESPONSE-DATA-FORMAT=XML'. '&GLOBAL-ID=EBAY-DE'. '&itemFilter(0).name=Seller'. '&itemFilter(0).value=cpo_handel'. '&paginationInput.entriesPerPage=10'. '&keywords=Radmuttern*';
This is the same call NOT working via XML:
======================= webcall(https://svcs.ebay.com/services/search/FindingService/v1) ======================= outgoing Headers were: ----------------------- POST /services/search/FindingService/v1 HTTP/1.1 Host: svcs.ebay.com Accept: */* X-EBAY-SOA-OPERATION-NAME: findItemsAdvanced X-EBAY-SOA-SERVICE-VERSION: 1.13.0 X-EBAY-SOA-GLOBAL-ID: EBAY-DE X-EBAY-SOA-SECURITY-APPNAME: CPO... Content-Type: text/xml Content-Length: 476 ----------------------- request body: ----------------------- <?xml version="1.0" encoding="utf-8"?> <findItemsAdvancedRequest xmlns="https://www.ebay.com/marketplace/search/v1/services"> <paginationInput> <entriesPerPage>10</entriesPerPage> <pageNumber>1</pageNumber> </paginationInput> <itemFilter> <name>Seller</name> <value>cpo_handel</value> </itemFilter> <keywords>Radmuttern*</keywords> <MessageID>RHJk4jEyDHcElycamgA0uTSN1rl46jEpDbyj3R5yZvI=</MessageID> <Site>Germany</Site> </findItemsAdvancedRequest> -----------------------
...giving the response:
array ( 'retcode' => '200', 'headers' => array ( 'Server' => 'Apache-Coyote/1.1', 'X-EBAY-SOA-SERVICE-METRICS' => '12863500', 'X-EBAY-SOA-REQUEST-ID' => '16f0efc4-ef20-a9e4-1454-4ab4ffaf4af5', 'X-EBAY-SOA-SERVICE-VERSION' => '1.13.0', 'X-EBAY-SOA-LOCALE-LIST' => 'en-DE_DE', 'X-EBAY-SOA-MESSAGE-PROTOCOL' => 'NONE', 'X-EBAY-SOA-RESPONSE-DATA-FORMAT' => 'XML', 'X-EBAY-SOA-GLOBAL-ID' => 'EBAY-DE', 'X-EBAY-SOA-OPERATION-NAME' => 'findItemsAdvanced', 'X-EBAY-SOA-SERVICE-NAME' => '{http://www.ebay.com/marketplace/search/v1/services}FindingService', 'Content-Type' => 'text/xml;charset=UTF-8', 'Transfer-Encoding' => 'chunked', 'Date' => 'Mon, 16 Dec 2019 13:53:33 GMT', ), 'data' => array ( 'ack' => 'Failure', 'errorMessage' => array ( 'error' => array ( 'errorId' => '6', 'domain' => 'Marketplace', 'severity' => 'Error', 'category' => 'Request', 'message' => 'Keyword or category ID are required.', 'subdomain' => 'Search', ), ), 'version' => '1.13.0', 'timestamp' => '2019-12-16T13:53:33.954Z', ), )
Any idea whats wrong with the XML version?
Solved! Go to Best Answer
12-16-2019 09:02 AM
Solved: The eBay API documentation is erroneous at a rather well hidden point:
https://developer.ebay.com/devzone/finding/Concepts/MakingACall.html#xml
...stipulates that the namespace argument of the documentElement of the XML envelope should be:
xmlns="https://www.ebay.com/marketplace/search/v1/services"
The working example...
https://developer.ebay.com/DevZone/finding/HowTo/GettingStarted_PHP_XML_XML/GettingStarted_PHP_XML_XML.zip
...differs in one single character from that stipulation: http without "s".
Changing that one character in my source, i got it to work.
Thus, the API documentation is proven erroneous.
While being an incredible tiny thing, it successfully avoids detection. The better you are in notoriously exactly following the advises, the smaller your chances of detecting that error an the basis of the API documentation.
Luckily, the example provided a working solution, thus going line by line, header by header, value by value through each and every parameter, i ended up at that little character in the xml Namespace descriptor.
Boys at eBay: Those descriptors are so **bleep** irrelevant to the content of the API... But YOU (!) the heck go on full strike if a single tiny character is wrong... AND: YOU (!) are the ones who provides the wrong character in your so called "documentation".
Make your homework, guys!
12-16-2019 06:37 AM
12-16-2019 09:02 AM
Solved: The eBay API documentation is erroneous at a rather well hidden point:
https://developer.ebay.com/devzone/finding/Concepts/MakingACall.html#xml
...stipulates that the namespace argument of the documentElement of the XML envelope should be:
xmlns="https://www.ebay.com/marketplace/search/v1/services"
The working example...
https://developer.ebay.com/DevZone/finding/HowTo/GettingStarted_PHP_XML_XML/GettingStarted_PHP_XML_XML.zip
...differs in one single character from that stipulation: http without "s".
Changing that one character in my source, i got it to work.
Thus, the API documentation is proven erroneous.
While being an incredible tiny thing, it successfully avoids detection. The better you are in notoriously exactly following the advises, the smaller your chances of detecting that error an the basis of the API documentation.
Luckily, the example provided a working solution, thus going line by line, header by header, value by value through each and every parameter, i ended up at that little character in the xml Namespace descriptor.
Boys at eBay: Those descriptors are so **bleep** irrelevant to the content of the API... But YOU (!) the heck go on full strike if a single tiny character is wrong... AND: YOU (!) are the ones who provides the wrong character in your so called "documentation".
Make your homework, guys!