Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

...

...

...

...

...

...

...

...

...

...

...

...

Method description

Returns the top product attributes for a specific user and session.

...

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.

HTTP method

GET

URL schema

No Format
/v2/usercontext/preferences/{client_id}?user={user_id}&session={session_id}&rows={rows}

Path Parameters

Parameter nameRequiredDescription
client_id(tick)Client identifier on the system

URI Parameters

Parameter nameRequiredDescriptionDefault
user_id(tick)Identifier that represents an unique user along the client
session_id (error) 

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 (error) Number of values of each field1

Responses

200 - successful request

Type: application/json

Code Block
titleExample 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}
      ]
    }
  ]
}    	
400 - mandatory query parameter is missing

Type: application/json

Code Block
titleExample application/json
{
  "code": 400,
  "error": "XXX is mandatory"
}
404 - either client or endpoint don't exist

Type: application/json

Code Block
titleExample application/json
{
  "code": 404,
  "error": "XXX not found"
}

Filter by label (Content by label)
cqllabel = "empathy-contextualize-api-rest" and space = currentSpace()