Microsoft bot integration with ServiceNow Virtual Agent using Virtual Agent API

surajmusmade18
Tera Contributor

Hello,

 

I want to integrate the Microsoft bot with ServiceNow Virtual agent in which I will consume ServiceNow VA as a secondary bot. Using Virtual Agent API I am able to send Inbound requests to ServiceNow VA and also got responses from ServiceNow VA to configured outbound third-party endpoint.

 

I've been using the following API to send requests to ServiceNow VA.

scripted-rest-api-endpoint.png

 

Currently, the responses getting from ServiceNow Virtual Agent on an outbound third-party endpoint but how can we get these responses in my MS Bot?

Also, is it possible to get a response from ServiceNow VA using its BOT integration API without configuring an outbound third-party endpoint in the rest message?

 

Thanks in advance!

 

22 REPLIES 22

@Rahul Kumar3 

I'm curious to know why you had to replicate the VABotToBotRestMessageHandler script.

The VABotToBotRestMessageHandler script was read only and and I wanted to pass every request coming to _processRequest function synchronously by returning _processRequestSync function for both condition.

I did following changes in VABotToBotRestMessageHandler script.

surajmusmade18_0-1673503896865.png

 

Try updating the form layout of sys_cs_channel table.

Can you share the path of layout of sys_cs_channel table. Because, as you can see in below screenshot in sys_cs_channel.list record I don't see the checkbox.

 

surajmusmade18_1-1673504463990.png

 

 

 

 

@surajmusmade18 ,

The synchronous flag will not be available on the sys_cs_channel form by default. You need to add the field manually by configuring the form layout. 
Follow the below doc to configure the form layout 

https://docs.servicenow.com/en-US/bundle/tokyo-platform-administration/page/administer/form-administ...

Hi @Rahul Kumar3 ,

Thanks for the help. After setting synchronous checkbox to true, I can see the response from a virtual agent when I call my bot integration API without modifying any script.

 

I just did not understand the use of the outbound rest endpoint configured in rest messages. How can it help us to integrate ServiceNow VA with Microsoft bot framework bot? 

When your channel is asynchronous, the VA bot response will be sent to the outbound rest endpoint configured in rest messages. 

Does this mean we will need to make two API calls from the Microsoft Bot? One Inbound to send the request to ServiceNow VA and other outbound to get the response and show it back in MS Bot?