Join Free
+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11
  1. #1

    Issue with enableFacets


    I am trying to get the Trend results for the last 30 days with only the productId, brand, merchant and category facets enabled.

    This is the URL Request.

    PHP Code: 
    They are pipe separated and everthing is URL Encoded. I get this returned.
    PHP Code:
    errors] => Array

    warnings] => Array

    facets] => 
    totalRecords] => 1
    [totalRecordsAvailable] => 100
    [totalRecordsFound] => 29653

    If I ask for just one Facet, let's say category it works but when I ask for more than one it does not.

    Also, if I ask for just productId it returns nothing but if I set enableFacets to just true I get productId results.

    Clearly I am doing something wrong but what the hell is it?

    Finally, I am seeing that in the Category Facet the value field is : delimited, where as for the Search Endpoint they are sometimes > and comma delimited. Is this deliberate and if so what is the difference?

    PHP Code:
    [value] => Women:Shoes:Sandals
    [value] => Shoes>Ladies Shoes>Ladies Dress Shoes>Easy Street Dress
    [value] => BagsWallets and Luggage 
    Last edited by andyscraven; 06-12-2014 at 07:21 AM.

  2. #2
    1) Don't url encode
    2) Your url is formatted incorrectly

    should be:

    PHP Code:,20140612&enableFacets[]=productId&enableFacets[]=brands&enableFacets[]=merchants&enableFacets[]=category&limit=50 
    RE: your second question. This is up to the merchant. I've seen > , | & as delimiters. I think there's someone on the forum here who tried making a list of those.

  3. #3
    Thanks for the reply.

    I was going by the Prosperent documentation. "All parameter values must be URL encoded. Failure to do so may result in unexpected results from the API. Refer to the documentation of the programming language you are using for more information on URL encoding."

    and their example below that comment shows a piped url encoded request.

    PHP Code:
    // This is NOT URL Encoded
    &filterMerchant=Starwood Hotels Resorts|Wyndham Hotel Group

    // This is URL Encoded correctly
    It has to be said this is the only thing I am having an issue with, URL encoding seems to work for everything else.
    Last edited by andyscraven; 06-13-2014 at 05:23 AM.

  4. #4
    We will take a look at this. And yes, urlencoding should be done. If it does not work when encoding, let us know so we can get it to work.

  5. #5
    Hi Andrew, it doesn't work when I urlencode the request or not.

    Before it is encoded the enableFacets looks like this:

    PHP Code:
    Is that correct?

    Should it be singular brand and merchant or plural as neither work when piped together as above.

  6. #6
    Aha!!!! I knew it would be something simple. Thanks Andrew I will test that now while you update the docs :-)

  7. #7
    We are looking into it now.

  8. #8
    Thinking about it then there is no need to urlencode the enableFacets parameters at all then given they are all single words.

    PHP Code:
    should be absolutely fine.

    Singular brand and merchant or plural?

  9. #9
    After looking into this, it would still be recommended to urlencode the entire string including the pipes to avoid any unexpected results. It may work without encoding in this particular situation, but other situations it may be necessary. You will have less issues in the future if you maintain consistency.

    Quote Originally Posted by andyscraven View Post
    Singular brand and merchant or plural?

  10. #10
    Hmmm, I am getting no results at all when I send multiple facets pipe delimited using this URL:

    PHP Code: 
    Does this look like it should get results?


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
coupons | coupons and deals