Getting Started with the Personalized Search API
A Monetate Personalized Search experience involves the following steps:
- Create an Omnichannel experience configured with a Personalized Search action in the Monetate platform.
- Return auto-suggestion results as the customer types into the search field.
- Return complete records as a query when the customer executes a search.
Follow these steps to create the Personalized Search experience:
- Obtain the search token. After you create and activate a Personalized Search experience in the Monetate platform, send a decision request to the Engine API on page load to receive a search token in the response. This token contains the relevant information for the experience, and it's required for all Personalized Search API calls. Include this token in the request calls for search activity on the same page, and then request another search token when the customer navigates to another page of your site.
- Optionally, configure any redirects. If the Personalized Search experience has any URL redirects defined, then you must also make a Personalized Search API call to configure these redirects. URL redirects are predefined search terms that go to a specific page instead of returning a list of search results. Because redirects should not change often, you can cache the configuration and make this call less frequently to improve page load speed. The recommended caching interval is 12 to 24 hours.

Auto-suggestions return live results as the customer types each character in their search term. Results are returned as a response to a Personalized Search API call made after the customer types a new character. This type of request is "AUTO_SUGGESTIONS".

Finally, complete records are returned after the customer executes a search. An executed search is referred to as a query. The process for a query is as follows:
- Check for any applicable redirects and handle those as necessary.
- If no redirects are applicable, use a Personalized Search API call with the search request type "SEARCH" to return the records.
