PDA

View Full Version : New forum for product api specific questions



prosperent brian
11-08-2011, 01:36 PM
Title says it all

oneStop
03-29-2013, 05:23 PM
Hi,

I program in ASP.NET (PHP is Greek to me).

Are there any code examples in .NET?

P.S. Also, what it the recommended way to specify an AND query. (foo AND bar ) where the product names returned will not have only foo or only bar in them -- but all product names will contain BOTH foo and bar.


Mark

prosperent brian
03-30-2013, 10:05 AM
Hi Mark, we don't currently have any .NET examples. Most people that use the API have been php developers at this point, but the api is completely language agnostic. Your best bet for a query such as the one above would be a phrase match. In a phrase match query, the results must contain all specified words. The syntax is just "foo bar". You would need to perform an extended query in this case which overrides all of our built in query optimization so you can specify exactly what you want.

For every endpoint there is a url like:
http://api.prosperent.com/api/search
http://api.prosperent.com/api/coupon/search
http://api.prosperent.com/api/trends?commissionDateRange=20120901,20130228&query=shoes
...


And for valid GET requests you have to pass required parameters, everything is in documentation. There is also JSONP support (add parameter callback), for cross site scripting.

oneStop
04-01-2013, 03:44 PM
I ran into a problem where the api returns "An unexpected error occurred" if the extended query contains a # character, or if an @ character is the first character in a word.

What is the proper way to handle special characters?

Mark

312k1t
04-01-2013, 11:19 PM
You have to encode it http://stackoverflow.com/a/11236038/445716

BTW: I'm using Uri.EscapeDataString and it works OK.

AcidRaZor
04-02-2013, 12:26 AM
If you can program in .NET (I assume C#) and have done JavaScript, then picking up PHP is as easy as taking a piss