Versions Compared

Key

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

The purpose of this document is to explain a normal requests flow at EmpathyX. Which APIs are we calling, when are we calling them and which parameters are needed...

These requests are already explained under our Empathy Search REST API public documentation

...

(https://searchbroker.atlassian.net/wiki/label/EBKB/empathy-api?ids=78257279&ids=78257279&startIndex=0)

Events:

...

Opening EmpathyX

Once EmpathyX opens, we make 2 requests.

One for the [top clicked] (https://searchbroker.atlassian.net/wiki/spaces/EBKB/pages/78615907/Search+REST+API%3A+ (Search REST API: TopClicked) products, and another one to get the [popular searches]  (https://searchbroker.atlassian.net/wiki/spaces/EBKB/pages/105775310/Search + REST +API%3A+API: Empathize).

The purpose of this two requests is to show the most popular products and queries when the user has not typed any search query yet. Also, we usually show the user history in this state too, but as it is stored on the `localStorage`, we don't have to make any request.-

Top clicked on empty search


Depending on where these top clicked products are shown on the designs (outside of the empathize, or inside of it), we send `empty_search` or `empathize_recommendations` as the origin parameter to the request, so the results come with an `ebTagging` property with the proper tagging URLs we need to call to when the user triggers one of those events (add to cart, click, or conversion).

For example, if the top-clicked products are shown outside the empathize we use this request (:

https://api.empathybroker.com/search/v1/query/massimodutti/topclicked?lang=es&store=34009450&scope=desktop&warehouse=32109461&catalogue=30359498&rows=12&origin=empty_search

...


On the other hand, if these top-clicked products are shown inside the empathize, we must tag them with the `empathizeempathize_recommendations` originrecommendations origin, using this call:(

https://api.empathybroker.com/search/v1/query/massimodutti/topclicked?lang=es&store=34009450&scope=desktop&warehouse=32109461&catalogue=30359498&rows=8&origin=empathize_recommendations

...

...

Popular searches

Popular searches are displayed commonly inside the empathize. For retrieving them, we just have to make a call to the [`/empathize`](https://searchbroker.atlassian.net/wiki/spaces/EBKB/pages/105775310/Search+REST+API%3A+Empathize) empathize (Search REST API: Empathizeendpoint without a query.

Whenever a user clicks on one of these suggestions, we must [track the query] (https://searchbroker.atlassian.net/wiki/spaces/EBKB/pages/78616687/Tagging + REST +API%3A+API: TrackQuery), with the origin `empathizeempathize_trending`trending.-

Next queries suggestions

 


This suggestions depends on the last query we have done. It will be shown when this last query has next queries associated. They are displayed differently depending on whether there is query in the search box or not.

To visualize these kind of suggestions we have to make a call of this type:

https://api.empathybroker.com/search/v1/query/massimodutti/nextqueries?q=camiseta&lang=es

...

Suggestions


This is the call we use to show suggestions requested to the empathize endpoint:

https://api.empathybroker.com/search/v1/query/massimodutti/empathize?q=camisa&lang=es&store=34009450&warehouse=32109461&catalogue=30359498&rows=5

...

Search response

This is the call we use to retrieve search results:

https://api.empathybroker.com/search/v1/query/massimodutti/searchv2?q=camisa%20camisa&catalogue=30359498&rows=24&start=0&scope=desktop&lang=es&store=34009450&warehouse=32109461&origin=default&user=03f5c57a-69e6-4cee-8f29-e81bfea1075e&session=570096c3-43cf-4cbd-8e7a-75517150ed4c&user_type=recurrent-

Related tags


Related Tags are a great tool to help users articulate a more specific query. They provide refinement suggestions that are inferred through collaborative filtering 

To visualize these related tags we have to make a call of this type:

https://api.empathybroker.com/search/v1/query/massimodutti/relatedtags?q=camisa&lang=es-

Next queries

Next Queries: users get exposed (see use cases below) to the queries that are contextually relevant to their current ones. Next queries are generated from all users who previously searched with that/those terms, what they did next.

To visualize text queries we have to make a call of this type:

https://api.empathybroker.com/search/v1/query/massimodutti/nextqueries?q=camisa&lang=es-

Partial results


When we search for more than one term and have no results, this functionality will show us the results for each of the queries.

https://api.empathybroker.com/search/v1/query/massimodutti/searchv2?q=camisa%20calcetines%20&catalogue=30359498&rows=24&start=0&scope=desktop&lang=es&store=34009450&warehouse=32109461&origin=default&user=03f5c57a-69e6-4cee-8f29-e81bfea1075e&session=570096c3-43cf-4cbd-8e7a-75517150ed4c&user_type=recurrent-

Top clicked (no results)


This is the call we make to show top clicked when a user´s query has no results:

https://api.empathybroker.com/search/v1/query/massimodutti/topclicked?lang=es&store=34009450&scope=desktop&warehouse=32109461&catalogue=30359498&rows=12&origin=no_results