Reputation: 21
I am trying to implement a search functionality using webhook. I want to save user utterance in a parameter in case user query does not match any intent on start page. Is there any way to save user utterances in parameter so that it can be used by webhook . Currently no match intent is invoked correctly but utterance does not go to webhook.
Upvotes: 0
Views: 1272
Reputation: 228
You should be able to extract the original user query and pass it as a parameter to your CX agents using webhook.
To do so, you should enable the “Use Webhook” option on the specific route where you want the user query to be extracted. When that route is triggered, you should be able to extract the original user query in your Webhook Request’s query union field. Here are the four possible Webhook Request fields where you can extract the relevant data based on the input type that the user provided:
“text” field - if natural language text was provided as input.
“transcript” field - if natural language speech audio was provided as input.
“trigger_event” field - if an event was provided as input.
“trigger_intent” field - if an intent was provided as input.
The user query that you extracted can then be passed as a parameter to your CX agent by adding it to your WebhookResponse body inside either of the following field:
Here’s an example webhook response containing a session parameter:
jsonResponse = {
"session_info":
{
"parameters":
{
"parameter_name": "parameter value"
}
}
};
Upvotes: 3
Reputation: 373
What you can do:
no-match-utterance
(or something else) of type @sys.any
. This will make sure that any reply is caught.$session.params.no-match-utterance
.Upvotes: 1