Thanks for the reply @xiang.developersupport . I have read that document and have url encoded my requests as I put in my question. I'm tearing my hair out as many queries are not working as they should. I'm using the excellent AspectHistogram in order to build up a list of aspects to search from, but many are coming back with 0 results even though the histogram says there are hundreds available. Using
http://svcs.ebay.com/services/search/FindingService/v1?SECURITY-APPNAME=XXX&OPERATION-NAME=findItemsAdvanced&SERVICE-VERSION=1.13.0&GLOBAL-ID=EBAY-GB&RESPONSE-DATA-FORMAT=JSON&REST-PAYLOAD&categoryId=18206&outputSelector=AspectHistogram&; as my starting point for Honda cars, I add: aspectFilter(0).aspectName=Model&aspectFilter(0).aspectValueName=Civic and it successfully brings back Honda Civics However, if I use: aspectFilter(0).aspectName=Car_Type&aspectFilter(0).aspectValueName=Coupes it brings back 0 results despite there being 900 available in the histogram. Estates also bring back 0. I've done a successful query for Automatics, black, 5 doors. aspectFilter(0).aspectName=Transmission&aspectFilter(0).aspectValueName=Automatic&aspectFilter(1).aspectName=Colour&aspectFilter(1).aspectValueName=Black&aspectFilter(2).aspectName=Doors&aspectFilter(2).aspectValueName=5 So what doesn't work? "Car_Type". But the underscore is a valid character I believe and doesn't change when I use PHP urlencode. I've seen that underscore can be replaced by %5F but this has no effect in my queries. I'd be grateful of some assistance please.
You're right, using a space does bring results back when viewed in a browser, but the php curl command fails every time with an error "transfer closed with 117 bytes remaining to read". I accept this is a different problem, but only occurs when spaces are used, so related. I've asked for help on stackoverflow, but if anyone has seen this before please let me know.
You probably aren't urlencoding the spaces. Replace them with %20 (rawurlencode) or + (urlencode). In PHP, cURL, PHP+cURL, and other languages, you need to encode any parameters that may contain spaces for any URL requests (not just eBay APIs). Spaces are not supported in URLs. Browsers do this substitution for you, which is why it works in the browser. Don't encode the entire URL, just encode the parameters.