Get Recs
Get Recs is how you access our taste preference-based recommendations for customers.
Get Recs calls are based on a specific Object_Collection. The collection defaults to your primary inventory.
Use Preferabli.main().getRecs(Object_Product.Other_ProductCategory product_category, Object_Product.Other_ProductType product_type, Long collection_id, Integer price_min, Integer price_max, ArrayList
Get Recs returns the Object_Recommendation object.
Here is an example:
Preferabli.main().getRecs(Object_Product.Other_ProductCategory.WINE, Object_Product.Other_ProductType.RED, Preferabli.PRIMARY_INVENTORY_ID, null, null, null, null, null, new API_ResultHandler<Object_Recommendation>() {
@Override
public void onSuccess(Object_Recommendation data) {
// Do what you like with the message & products returned.
}
@Override
public void onFailure(API_PreferabliException e) {
// Call failed.
}
});
You can narrow down a Get Recs requests by passing in foods and styles.
To narrow the results to products that pair well with a given Object_Food, call Preferabli.main().getFoods(API_ResultHandler<ArrayList<Object_Food>> handler) to get a list of available foods and then pass an array of ids to the Get Recs call.
To narrow results to products of a specific Object_Style, first call Preferabli.main().getProfile(Boolean force_refresh, API_ResultHandler<Object_Profile> handler) to get a customer's Object_Profile. The profile object returned contains an array of their Profile Styles. Pass an array of ProfileStyle.style_id to limit results to ones that apply to the styles passed.
Updated about 1 year ago
