Contextualize REST API: Category context

Method description

The category context allows to evaluate the user navigation data to offer a score to each product that indicates the weight that it has within each category according to this data and the concrete configurations of the product fields given by the client.

Returns the scores for the products indicated in the categories configured for the client. This method get all the categories available for the client and check what is the score weight for each one of the product ids indicated in the request. Is required that this endpoint receive at least one product id to get the scores.

HTTP method

GET

URL schema

/v2/categorycontext/{client_id}/scores?pid={pid}&pid={pid}&pid={pid}

URL example

/v2/categorycontext/ebdemo/scores?pid=2201331&pid=1265192&pid=1241510

Path Parameters

Parameter nameRequiredDescription
client_id(tick)Client identifier on the system
lang(error)Default_lang set by configuration

URI Parameters

Parameter nameRequiredDescriptionDefault
pid


(tick)

Search category scores for this product. Is required to send one at least.-

Responses

200 - successful request

Type: application/json

Example application/json
[ 
 { "productId": "pid1", 
   "scores": [
     { 
       "categoryId": "1", 
       "weight": 50.0
     } , 
     { 
       "categoryId": "2", 
       "weight": 10.0
     }
   ]
  },
 { "productId": "pid2", 
   "scores": [
     { 
       "categoryId": "3", 
       "weight": 100.0
     }
   ] 
  } 
 ]
400 - mandatory query parameter is missing

Type: application/json

Example application/json
{
  "code": 400,
  "error": "productId is mandatory"
}
404 - either client or endpoint don't exist

Type: application/json

Example application/json
{
  "code": 404,
  "error": "XXX not found"
}