REST-API

For most API methods for recommendations, you will need to provide the Product Box ID.
Note:
It is important that you bundle the product recommendations to ensure no duplicates.
get
https://www.addwish.com/api/v1/product-recommendation/getProductBoxes
Get Product Recommendations
Example:
https://www.addwish.com/api/v1/product-recommendation/getProductBoxes?trackingUserId=544e3f41e4b05e538f4512d2&format=json&ids=1234567890abcdef12345678,abc4567890abcdef12345432&url=http%3A%2F%2Fwww.example.com%2Fjeans%2Ffancy-jeans-002.html&crawledData[1234567890abcdef12345678][category]=Kitchen%20utensils

Details about passing filter values (crawledData) to getProductBoxes()

In some situations, it makes sense to filter which products are returned from the product recommendation engine. Maybe you want products cheaper than a certain limit, only products from a specific brand or category. This can be done by adding filtering to the recommendation engine. It is possible to pass values to use for filtering the recommendation API call. The algorithm needs to be configured by Hello Retail before it can accept filter values as input. So get in touch with [email protected] to get help configuring the algorithm.
All parameters are sent in the query string. The parameter name for passing filter values is crawledData. The filters must be sent per recommendation box and you should supply the filter name.
Brand filter Passing a brand filter with the value “Nike” for a box with the ID 123 will look like this in the query string:
&crawledData[123][brand]=Nike&
Categories filter In the Hello Retail backend categories are stored in a field called hierarchies that contains a list of category hierarchies the product is in. So a product can be in multiple hierarchies at once. As an example, a pair of women's sandals on sale could have the following hierarchies:
[ ["Shoes", "Woman"], ["On sale", "Woman"], ["Sandals"] ]
So these sandals are in the “Woman” subcategory below the “Shoes” category, they are also in the “Woman” subcategory below the “On sale” category, and finally, they are in the “Sandals” category.
So when passing a filter value for filtering on hierarchies the passed filter value needs to follow the same structure but encoded as query string variables. So if we wanted to pass a filter saying that the products must be in the “Woman” subcategory below the “On sale” category the query string would look something like this:
&crawledData[123][hierarchies][0][]=On sale&crawledData[123][hierarchies][0][]=Woman&
As you can see, you need to supply the index for the first level in the hierarchy, but for the second one, you can pass an empty set of square brackets, and the ordering of the parameters will decide the numbering.
It is possible to pass multiple hierarchies to one filter. So if you wanted to find “Woman” “Shoes” that are also “Sandals” you could pass the filter:
&crawledData[123][hierarchies][0][0]=Shoes&crawledData[123][hierarchies][0][1]=Woman&crawledData[123][hierarchies][1][0]=Sandals&
extraData & extraDataList The examples above are reserved attributes in the Hello Retail backend. Everything besides these must have extraData or extraDataList in front. The declaration of these variables needs to be configured by Hello Retail before it can be used as crawlData parameters. So get in touch with [email protected] to get help configuring the algorithm. So when passing an extraData or extraDataList filter value for filtering on lists or single values, the structure has to follow this:
&crawledData[123][extraDataList][series][]=Cars&crawledData[123][extraDataList][series][]=Scooters&
&crawledData[123][extraData][carBrand]=Toyota