Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

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

PreranaPolekar
Tera Contributor

I am trying to integrate the same in one of my Microsoft Bot. Is there a away we can reach out to ServiceNow support team for such queries? 

Rahul Kumar3
ServiceNow Employee
ServiceNow Employee

hi @surajmusmade18 , 
You can't send the VA API response directly to the MS bot as MS Bot might not be able to understand the VA API response payload. You will need a transformation layer in between. 

 

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? 

=> You can also use VA API in sync mode. To use VA API in sync mode: 
Goto sys_cs_channel table -> open the record named (Bot-to-Bot) and set the synchronous checkbox to true.

Thanks,

Rahul

Hi @Rahul Kumar3,

Thank you for responding.

 

>>You can't send the VA API response directly to the MS bot as MS Bot might not be able to understand the VA API response payload. You will need a transformation layer in between.

 

I have created one script include in which I have replicated the "VABotToBotRestMessageHandler" with minor changes.

I have called this script in my bot integration scripted rest API. So, when I call my Inbound bot integration API using postman, I can see the response of the virtual agent in postman.

And I am parsing the response got from ServiceNow virtual agent explicitly in MS bot composer to send it to the user.

So, is this the correct way to get a response from ServiceNow VA and to use ServiceNow VA as a secondary bot?

 

>> You can also use VA API in sync mode. To use VA API in sync mode:  Goto sys_cs_channel table -> open the record named (Bot-to-Bot) and set the synchronous checkbox to true.

 

I don't see any synchronous checkbox in my Bot-to-Bot channel record.

 

Also, I am not able to add any attachments in reply to this question. So, am I missing something?

@surajmusmade18 Your approach looks fine.

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

 

I don't see any synchronous checkbox in my Bot-to-Bot channel record.

Try updating the form layout of sys_cs_channel table.