Versions Compared

Key

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

...

...

...

...

...

...

...

...

...

...

...

...

...

...

Method description

Returns the last visited specific products for a specific user, session and query. 

"userLastViewedProducts" and "sessionLastViewedProducts" weight is calculated using the different between the last time there was an interaction with the product and "now". So, the more recent events will have more weight than others that happened long ago. 

HTTP method

GET

URL schema

No Format
/v2/usercontext/products/{client_id}?user={user_id}&session={session_id}&query={query}&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


query

(tick)

Search term that user did
rows (error) Number of products to return5

Responses

200 - successful request

Type: application/json

Code Block
titleExample application/json
{
  "userLastViewedProducts": [
    {"value":"213115", weight:"3"},
    {"value":"213149", weight:"1.3"}
  ],
  "sessionLastViewedProducts": [
    {"value":"213142", 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()