Warning

This site is no longer being maintained. Visit the eDocs documentation portal for updated information.

Visit eDocs
Dismiss message

Category Context - Preview

Created by Pedro Ondiviela · last update June 8, 2020

What is this about?

As discussed in the endpoint to obtain the category scores of the category products, the results depend on the users’ navigation events and the weights given by the client for the fields within each category. In order to have a vision of the changes that cause the changes in the weights of the fields (equalize) within a category, can obtain a fast preview of the results with this endpoint.

These results will be obtained by sending a customized equalize and calculating these scores taking into account only some days of navigation events data within a category.

About this Endpoint

Structure for calling the endpoint.

Request URL example

GET https://api.empathybroker.com/contextsearch/v2/categorycontext/{instance_id}/preview?{Input_Parameters}

Input Parameters

Parameter name Data Type
Required:  
categoryEqualize Object
categoryEqualizeEvents Object
categoryId Integer
Not required:  
lang String
field Object
maxProducts Integer


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
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
[
  {
      "pid": "656296",
      "eb_name": "Product 1",
      "eb_image": "../assets/product1.jpg",
      "scores": {
            "price": 0.3055021834061135,
            "stock": 0.054012821703985886,
            "color": 0.20550218340611354,
            "events" 0.1100000001
      },
      "events": {
            "browseCheckout": 0,
            "browseProduct": 10,
            "browseAdd2Cart": 3
    },
      "score": 0.675017188516213
  },
  {
      "pid": "2352351",
      "eb_name": "Product 2",
      "eb_image": "../assets/product2.jpg",
      "scores": {
            "price": 0.30078602620087336,
            "stock": 0.062488153860447836,
            "color": 0.20078602620087338,
            "events" 0.1100000001
      },
      "events": {
            "browseCheckout": 0,
            "browseProduct": 10,
            "browseAdd2Cart": 3
      },
      "score": 0.675017188616213
  },
  {
      "pid": "7515814",
      "eb_name": "Product 3",
      "eb_image": "../assets/product3.jpg",
      "scores": {
            "price": 0.3005240174672489,
            "stock": 0.02924742172256806,
            "color": 0.20052401746724893,
            "events" 0.1100000001
      },
      "events": {
            "browseCheckout": 0,
            "browseProduct": 10,
            "browseAdd2Cart": 3
      },
      "score": 0.675017188616213
  },
  ...
]