Category context

Created by Pedro Ondiviela · last update June 8, 2020

What is this about?

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.

About this Endpoint

Structure for calling the endpoint.

Request URL example

GET https://api.empathybroker.com/contextsearch/v2/categorycontext/{instance_id}/scores?pid={pid}&pid={pid}&pid={pid}

Input Parameters

Parameter name Data Type
Required:  
pid Integer
Not required:  
lang String


Responses

Responses examples for successful and failing calls to the endpoint.

200 400 404

Successful request

Type: application/json

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
[
 { "productId": "pid1",
   "scores": [
     {
       "categoryId": "1",
       "weight": 50.0
     } ,
     {
       "categoryId": "2",
       "weight": 10.0
     }
   ]
  },
 { "productId": "pid2",
   "scores": [
     {
       "categoryId": "3",
       "weight": 100.0
     }
   ]
  }
 ]