onSearch
callbackonSearch
callback associated with the search user journey. The callback looks like this:SearchInfo
parameter. AppState
along with the appropriate Condition
corresponding to the state that the app transitioned intoonSearch
callback invocation, if the search completes successfully and the app transitions to a screen showing search results, the app would return theAppState
as SEARCH_RESULTS along with condition SUCCESS , as shown below: SearchInfo
ParameterSearchInfo
contains the breakdown of the original search request. Its structure is as described below: AppState
sAppState
s are supported:SearchResultsAppState
): To be returned when the app performs a search and navigates to the search results screen. To indicate whether the search was successful or not, with a greater level of detail, please use the appropriate conditions. AddToCartAppState
): To be returned when the app performs an add-to-cart action. To indicate whether the add to cart was successful or not, with a greater level of detail, please use the appropriate conditions.UnsupportedAppState
): To be returned when the app is not ready to handle search yet. The Assistant will let the user know that the search is not yet supported by the app.AppState
WAITING
that is common across all UserJourney
types for completing asynchronous operations within the callback. Refer to the Asynchronous Action Handling section for details of how to deal with asynchronous operations.AppState
s supported by the AssistantSearchResultsAppState
)SUCCESS
ITEM_NOT_FOUND
ITEM_OUT_OF_STOCK
FAILURE
ITEM_NOT_SPECIFIED
AddToCartAppState
)SUCCESS
ITEM_NOT_FOUND
ITEM_OUT_OF_STOCK
FAILURE
ITEM_NOT_SPECIFIED
ITEM_AMBIGUOUS
ITEM_AMBIGUOUS_FORCE_UI
ITEM_QUANTITY_REQUIRED