Virtual Agent API - Default Topic

viniciusoliveir
Kilo Expert

Hello community, we`ve successfully connected the VA Chatbot to WhatsApp using the new VA API that came out on the Paris release, through a 3rd party messaging provider (e.g. twilio).

The problem is, anytime a user starts a chat through the API, the fallback topic is triggered instead, rather than the default topic that we need. 

When configuring VA on the portal, we are able to set in the widget instance the default topic sys_id that we want users to meet, but we have not seen such a way to specify what should be the default topic when triggering the VA chatbot through the API.

 

Has anyone been able to figure out a way for this? 

Thanks in advance.

1 ACCEPTED SOLUTION

viniciusoliveir
Kilo Expert

So just to close this topic, we`ve found a solution for this.

1 - The first issue was related to setting appropriate roles to our VA topic. Since the conversation starts through a non-logged user on whatsapp, we had to add the "public" role to the topic. Once we've done that, the system was able to present the topic to the user.

2 - Now, since we are using keyword-based topics, we had to find a way to trigger that one topic, no matter what the user input - and for sure the user would not enter the keyword that could trigger our topic.

3 - To resolve this, we`ve ended up adding a condition to intercept the first user message in our VA API scripted REST resource, by capturing the "START_CONVERSATION" contextual action on the request, and then we've replaced that first user message with the topic keyword.

 

View solution in original post

13 REPLIES 13

Exactly. However, think about the scenario where the customer says 'hello' on whatsapp for the first time, and this information goes to the Virtual Agent.

The answer is automatically 'I am sorry but I didn't understand your request ...' instead of replying with the welcome message.

Unlike the portal, the conversation is initiated by the customer.

Whenever a conversation is initiated by the customer, the greetings topic has to be triggered, just like it happens today on the portal.

How can we configure the VA to start with the welcome message in this case?

Shipra8
ServiceNow Employee
ServiceNow Employee

Fair point. So, with Web and other chat interfaces, a greeting message is displayed when the chat session is established. Virtual Agent API is based on a Request/response paradigm wherein the user will initiate a request and VA will respond to that request. If your user typed a special command to start a new conversation using contextual action then they will get the Greeting message as follows - 

"Flow Designer output"{
"requestId":"221bas2be70-sadsa-we32-3eq2-1231rtz",
"clientSessionId":"",
"message":{
"text":"hola",
"typed":true
},
"userId":"abel.tuter",
"body":[
{
"uiType":"OutputText",
"group":"DefaultText",
"value":"Hi, I'm your Virtual Agent. Let me know how I can help you today.",
"maskType":"NONE"
},
{
"uiType":"TopicPickerControl",
"group":"DefaultPicker",
"nluTextEnabled":false,
"promptMsg":"Hi guest, please enter your request or make a selection of what I can help with. You can type help any time when you need help.",
"label":"Show me everything",
"options":[
{
"label":"Test B2B 2",
"value":"8373e55cdb8120108249f7541d96196d",
"enabled":true
},
{
"label":"FAQ Conversation Builder_Global",
"value":"9f3114a3dbc520108249f7541d961981",
"enabled":true
},
{
"label":"Get to know you",
"value":"a443dd6adb812010d3d6d9595e961954",
"enabled":true
},
{
"label":"Get to know you_Global",
"value":"b1a56b87db8120108249f7541d9619b2",
"enabled":true
},
{
"label":"Live Agent Support.",
"value":"ce2ee85053130010cf8cddeeff7b12bf",
"enabled":true
},
{
"label":"Test B2B topic",
"value":"d948c94cdb052010d3d6d9595e961969",
"enabled":true
}
]
}
],
"score":1
}

viniciusoliveir
Kilo Expert

So just to close this topic, we`ve found a solution for this.

1 - The first issue was related to setting appropriate roles to our VA topic. Since the conversation starts through a non-logged user on whatsapp, we had to add the "public" role to the topic. Once we've done that, the system was able to present the topic to the user.

2 - Now, since we are using keyword-based topics, we had to find a way to trigger that one topic, no matter what the user input - and for sure the user would not enter the keyword that could trigger our topic.

3 - To resolve this, we`ve ended up adding a condition to intercept the first user message in our VA API scripted REST resource, by capturing the "START_CONVERSATION" contextual action on the request, and then we've replaced that first user message with the topic keyword.

 

 Hello,

I am facing an issue with virtual agent api, Connection is successful form postman. but getting below log how to fix this issue. Please if you could help me on this.

Payload : 

{{
"requestId": "322bas2be70-sadsa-we32-3eq2-1231ra9",
"token": "ABCDEF",
"botToBot": true,
"clientSessionId": "",
"silentMessage": false,
"message":{
"text": "Live Agent Support.",
"typed": true
},
"userId": "beth.anglin",
"emailId": "beth.anglin@example.com",
"timestamp": 1588824102,
"timezone": "America/New_York"
} }"

Getting below log: 

Flow Designer output {"requestId":"422bas2be70-sadsa-we32-3eq2-1231ra9","clientSessionId":"","message":{"text":"Live Agent Support.","typed":true},"userId":"beth.anglin","body":[{"uiType":"ActionMsg","actionType":"SubscribeToSupportQueue","supportQueue":"{@type=InteractionQueue, external=false, active=false, averageWaitTime=, numericAverageWaitTime=0, type=interaction, queueAmbChannel=/cs/support_queue/c3lzX2lkPW51bGw=}"}],"score":1}

 

Thanks and Regards,

Sagar