Discovery Wall New Products

Created by Iago Fernández · last update December 10, 2019

About this endpoint

The purpose of this endpoint is to search in the catalog the top products for the given queries.

GET https://api.empathybroker.com/search/v1/query/{instance_id}/?products-by-queries{Input_Parameters}

Input Parameters

Parameter Type
q String
lang String

Implementation

Here is an example of a simple inmplementation in Java for consume this endpoint

1
2
3
4
5
6
7
8
9
10
11
12
13
Client client;
WebTarget target;
public void init(){
    client = ClientBuilder.newClient();
    target = client.target("https://api.empathybroker.com/search/v1/query/{instance_id}/products-by-queries")
       //Query parameters
        .queryParam("lang","ES")
        
}
 
public JSON getResponse(String query){
    return target.queryParam("q",query).request(MediaType.APPLICATION_JSON).get(JSON.class)
}

Output

The endpoint will return a Json containing the top products for the given queries

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
{
  "content": {
    "docs": [
      {
        "id": "4679",
        "internal_id": "4679",
        "reference": 4679.0,
        "name": "Leche Semidesnatada Brik",
        "description": "Leche Semidesnatada Brik 1 L",
        "brand": "PASCUAL",
        "imageUrl": "https://cdn-pre.aktiosdigitalservices.com/tol/consum/catalog/product/media/img/135x135/12542.jpg?t=20190906073304",
        "url": "https://preconsum.aktiosdigitalservices.com/consum/producto/pascual-/p-12542",
        "code": "12542",
        "eb_sku": "12542",
        "ebTagging": {
          "click": "https://api-staging.empathybroker.com/tagging/v1/track/consum/click?productId=4679&catalog=default&origin=default&store=default&title=Leche+Semidesnatada+Brik&type=4&follow=true&contextualizeApplied=none&url=https://preconsum.aktiosdigitalservices.com/consum/producto/pascual-/p-12542&externalBoosted=false&filtered=false&contextualizeEnabled=false&scope=default&page=1&position=1&lang=es",
          "add2cart": "https://api-staging.empathybroker.com/tagging/v1/track/consum/add2cart?productId=4679&catalog=default&origin=default&store=default&title=Leche+Semidesnatada+Brik&type=4&follow=true&contextualizeApplied=none&url=https://preconsum.aktiosdigitalservices.com/consum/producto/pascual-/p-12542&externalBoosted=false&filtered=false&contextualizeEnabled=false&scope=default&page=1&position=1&lang=es",
          "wishlist": "https://api-staging.empathybroker.com/tagging/v1/track/consum/wishlist?productId=4679&catalog=default&origin=default&store=default&title=Leche+Semidesnatada+Brik&type=4&follow=true&contextualizeApplied=none&url=https://preconsum.aktiosdigitalservices.com/consum/producto/pascual-/p-12542&externalBoosted=false&filtered=false&contextualizeEnabled=false&scope=default&page=1&position=1&lang=es",
          "conversion": "https://api-staging.empathybroker.com/tagging/v1/track/consum/add2cart?productId=4679&catalog=default&origin=default&store=default&title=Leche+Semidesnatada+Brik&type=4&follow=true&contextualizeApplied=none&url=https://preconsum.aktiosdigitalservices.com/consum/producto/pascual-/p-12542&externalBoosted=false&filtered=false&contextualizeEnabled=false&scope=default&page=1&position=1&lang=es",
          "checkout": "https://api-staging.empathybroker.com/tagging/v1/track/consum/checkout?productId=4679&catalog=default&origin=default&store=default&title=Leche+Semidesnatada+Brik&type=4&follow=true&contextualizeApplied=none&url=https://preconsum.aktiosdigitalservices.com/consum/producto/pascual-/p-12542&externalBoosted=false&filtered=false&contextualizeEnabled=false&scope=default&page=1&position=1&lang=es"
        }
      }
    ],
    "numFound": 1,
    "ebTagging": {
      "query": "https://api-staging.empathybroker.com/tagging/v1/track/consum/query?externalBoosted=false&filtered=false&contextualizeEnabled=false&totalHits=1&catalog=default&origin=default&scope=default&store=default&page=1&lang=es&contextualizeApplied=none"
    }
  }
}