Method description
Returns the top product attributes for a specific query. The product attribute weights are calculated based on user clicks, add-to-carts and purchases and the values are normalized using a linear function.
With segmentation can sent a user attributes list ("key":"value", ...) and number of tries in the request and the API try to return a segment data using this user attributes. If not have results for this user attributes in this number of tries it return the basic query context.
"topAttributes" objects don't have a fixed order and it may change in between requests. Although, values for each attribute are sorted by "weight" in descending order.
Remember that your EB Contextualize configuration could use different fields for the preference calculations, so the ones showing below ("brand" and "gender") are just examples.
HTTP method
GET
URL schema
/v2/querycontext/attributes/{client_id}?query={query}&lang={lang}&rows={rows}&userAttributes={userAttributes}&maxTries={maxTries}
URL example
/v2/querycontext/attributes/ebdemo?query=dress&lang=en&rows=2&userAttributes=gender:male,size:M&maxTries=3
Path Parameters
Parameter name | Required | Description |
---|---|---|
client_id | Client identifier on the system |
URI Parameters
Parameter name | Required | Description | Default |
---|---|---|---|
query | Search term that user did | ||
lang | Language of the query | ||
rows | Number of values of each field | 1 | |
userAttributes | User attributes to get segmentation data | - | |
maxTries | Max tries to do segmentation intents | 3 |
Responses
200 - successful request
Type: application/json
[ { "field": "brand", "values": [ {"value": "apple", "weight": 3}, {"value": "sony", "weight": 1.8} ] }, { "field": "category", "values": [ {"value": "mobiles", "weight": 3} ] } ]
400 - mandatory query parameter is missing
Type: application/json
{ "code": 400, "error": "XXX is mandatory" }
404 - either client or endpoint don't exist
Type: application/json
{ "code": 404, "error": "XXX not found" }
Related articles
-
-
EmpathyBroker Contextualize REST API (Empathy Knowledge Base)
-
-
-
Contextualize REST API: Query Context (Empathy Knowledge Base)
-
-
Contextualize REST API: Events (Empathy Knowledge Base)
-
-
Contextualize REST API: User Context (Empathy Knowledge Base)
-