Returns the top product attributes for a specific user and session.
The product attribute preferences are calculated based on user clicks, add-to-carts and purchases and the values are normalized using a linear function.
Both "userPreferences" and "sessionPreferences" objects don't have a fixed order and it may change in between requests. Although, values for each preference are sorted by "weight" in descending order.
Remember that your EB Contextualize configuration could use different fields for the preferences calculations, so the ones showing below ("brand" and "gender") are just examples.
GET
/v2/usercontext/preferences/{client_id}?user={user_id}&session={session_id}&rows={rows} |
/v2/usercontext/preferences/ebdemo?user=user_test&session=session_test&rows=5 |
Parameter name | Required | Description |
---|---|---|
client_id | Client identifier on the system |
Parameter name | Required | Description | Default |
---|---|---|---|
user | Identifier that represents an unique user along the client | ||
session | Identifier that represents an unique session for the given user along the client If it's not specified there isn't session object in response | ||
rows | Number of values of each field | 1 |
Type: application/json
{ "userPreferences": [ { "field": "brand", "values": [ {"value": "apple", "weight": 3}, {"value": "sony", "weight": 2.1} ] }, { "field": "gender", "values": [ {"value": "woman", "weight": 3} ] } ], "sessionPreferences": [ { "field": "brand", "values": [ {"value": "apple", "weight": 3} ] }, { "field": "gender", "values": [ {"value": "woman", "weight": 3} ] } ] } |
Type: application/json
{ "code": 400, "error": "XXX is mandatory" } |
Type: application/json
{ "code": 404, "error": "XXX not found" } |