The Now Platform® Washington DC release is live. Watch now!

Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Nabil Asbi
ServiceNow Employee
ServiceNow Employee

As of Utah release

 

Use the Virtual Agent API to integrate the ServiceNow Virtual Agent into your existing bot ecosystem. The Virtual Agent can be used as a secondary bot to provide answers and content to your existing deployed bot, or as a Primary bot to bring in conversations from a 3rd party bot or another ServiceNow Virtual Agent.

 

VictorChen_1-1675715748009.png

 

View the Virtual Agent API documentation here. View API request parameter in our API documentation.

 

Before Getting Started

  • Make sure you have a Pro/Enterprise license, which gives you access to the Virtual Agent and the API. 
  • Make sure your instance is on the Paris release or above.
  • Install the Virtual Agent API from the ServiceNow store, for the exact installation steps you can find more details here.

Review the inbound REST endpoint and configure inbound authentication

  • Topic discovery can either be performed by the Primary bot or ServiceNow VA. Please refer to key features for more details. 
  • You can POST either an intent or utterance to the VA REST endpoint.

Configure the output response REST endpoint and outbound authentication for the Virtual Agent API

  • Add your endpoint for your primary bot on VA outbound REST message.
  • Ensure your API authentication is configured correctly.
  • Because VA Bot is async, the instance will POST the JSON back to your endpoint to parse.
  • Review the response payload in our VA API doc.

Use Case 1: NLU In Secondary Bot

  1. A Primary Bot can send the user's utterance to all of the Secondary Bots in its ecosystem, and based on the boolean score returned back by secondary bots, it decides where to route subsequent requests. The boolean NLU score of 1 or 0 is returned by ServiceNow VA, where a score of 1 indicates an intent match and a score of 0 indicates no intent match.
  2. The Primary Bot will be intelligent enough to route utterances to the ServiceNow VA until the ServiceNow VA asks the Primary Bot to take control back. ServiceNow Virtual Agent will send a "takeControl" flag back to the Primary Bot in case it runs into consecutive failures with same utterance. The default value for this is 2.
  3. ServiceNow VA will also allow the Primary Bot to interact with agents via Agent Chat.

 find_real_file.png

Use Case 2: NLU In Primary Bot

  1. The Primary bot has the same NLU engine for all secondary bots to decide which secondary bot to route the request. Depending on the Primary Bot NLU decision, should the Primary Bot decide that ServiceNow Virtual Agent should handle these requests, it will route the conversation to ServiceNow Virtual Agent.
  2. The Primary Bot will be intelligent enough to route utterances to ServiceNow VA until ServiceNow VA sends back the message for the Primary Bot to take control back. ServiceNow Virtual Agent will send a "takecontrol" flag back to the Primary Bot in case it runs into consecutive failures with same utterance. 
  3. ServiceNow VA will also allow the Primary Bot to interact with agents via Agent Chat.

 

find_real_file.png

 

Example using Google Dialogflow as a Primary Bot, and ServiceNow Virtual Agent as a Secondary bot with a Slack interface

find_real_file.png

 

Demo

 

Implementation KB for Microsoft Azure bot-to-bot: https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1436882

 

Implementation FAQs

Q: Can ServiceNow serve as the primary bot? 

A: Yes, this feature is enabled out-of-the box for Azure bot, Google Dialogflow, or another ServiceNow VA bot. Find out more in our documentation - Bot Interconnect. For other bots, more custom development is required for integrations. As of the Utah release, Bot Interconnect is a separate store app that can be found in the ServiceNow Store. 

 

Q: How would the user authenticate to the Virtual Agent?

A: ServiceNow VA authenticates the provider. You can use the standard platform-supported authentication methods - most commonly Basic and OAuth. You will be able to set them up in REST resource that will become available in your instance once you install the Virtual Agent API Store App. Additionally, we also support JWT, Hash, and Static token-based authentication methods as described in our documentation. The Store App is needed to be able to set these up.

If the provider authentication is successful, we can link the user ID to their ServiceNow profile. In order for this auto-linking to happen, you will pass the user's email ID in request JSON. The account linking only works if you use one of the following token-based authentication methods - JWT, Hash, or Static. Also, the account linking only works with the email ID currently which is mapped against their ServiceNow profile email ID for a match.

 

Q: What is the difference between the Conversational Custom Chat Integrations option and the Virtual Agent API?

A: Conversational Custom Chat Integration Framework (CCCIF) is a framework that can be leveraged to bring ServiceNow Virtual Agent/Live Agent to any conversational interface or channel. You would use CCCIF for a chat client to VA server integration where customers need to transform our default rich controls into a format that can be rendered on the channel or interface they are integrating with (e.g. WebEx, BlueJeans, G-talk, etc.) This is a high-development effort and used when the other system has its own API request/response, so it requires transformations written using CCCIF. Note: using CCCIF also consumes IntegrationHub transactions. 

Virtual Agent API is an integration built on top of CCCIF. Virtual Agent API provides a REST-based Server-to-Server integration. One of the primary use cases Virtual Agent API supports is bot-to-bot integration where customers already have a bot in production but want to augment its capabilities by integrating with ServiceNow's VA in the background while causing no disruption to the end user experience. 

 

Q: Help, I'm unable to generate a response from the ServiceNow Virtual Agent?

A: First, check if adding the 'public' role to the Virtual Agent topic and try again. If that works, then check the auth configuration:

1) Message_Auth is configured on sys_cs_provider_application record. Documentation
2) You are passing a valid emailId in the request body. Request body parameters documentation

 

Q: How to generate the requestID in the JSON?

A: It is just a unique ID to help you identify the request you send to ServiceNow's Virtual Agent. It can be any alphanumeric character depending on your system or requirements.

 

Q: How to get the nowBotID in the JSON?

A: This is no longer used. Use the appInboundID in the response body to distinguish between multiple ServiceNow bots if you have them.

 

Q: Where to read the clientSessionID in the JSON?

A: This is an ID to help you keep track of the conversation that is taking place. This is how you identify that a given set of request and responses tie to an ongoing conversation with the user. The ID format and length depends on your system.

 

Q: How is NLU confidence returned for intent matches and non-matches across the bot-to-bot ecosystem?

A: In the Paris release, we will not be sending over the individual intent confidence scores (ie. 87%) but rather a boolean confidence match (0 or 1) that hits over the NLU model's CI threshold value for intent discovery match. System property va.bot.to.bot.score.normalization_factor can be utilized to dial up or down the individual intent confidence score to be on par with other bot intent matches. Our default is 1.

We will not be sending the confidence match as 0 if no intent match is found, which then invokes the Fallback topic and a match score of 0. To summarize, if NLU comes back with a Fallback, we will render it a score of 0.  

 

Q: Can I connect with a 3rd party live agent system (VA as the primary bot)?

A: Not at this time.

 

Q: I’m running to cross-scope privileges error when installing the Virtual Agent API. How do I resolve this?  

A: Navigate to System Applications > Application Cross-Scope Access. Filter by Source Scope = “Virtual Agent API”. Ensure that the Status field shows “Allowed” for all records. 

 

Q: What is the format in which the date time picker response has to be provided to the Virtual Agent?

A: We accept date time in milliseconds format. Here is an example:

find_real_file.png Format for date: "yyyy-mm-dd". Format for time: "hh:mm:ss". 

 

For more details please watch the Virtual Agent Academy recorded session on this topic: Augment your bot with ServiceNow workflows with the Virtual Agent API

 

 
Comments
lakshmi5
Mega Contributor

hi @Nabil Asbi 

i tried to do same but when i hit the url 

https://name.service-now.com/api/sn_va_as_service/bot/integration

it is giving a success message but active agent in work space is not receiving any chat notification.

can u please suggest me where i went wrong ASAP

Saima1
Kilo Contributor

Hi.

While trying to hit the inbound Rest API endpoint from Postman, I am getting the default response everytime wherein the score is 0.

I am trying to hit the Greetings topic.

URL: https://instanceName/api/sn_va_as_service/bot/integration

Request Body :

{
"action": "START_CONVERSATION",
"botToBot" : "true",
"message":{
                   "text" : "Greetings."
                }
}

Response in postman: 

{
"status": "success"
}

The logs show the response as below.

Flow Designer output {"message":{"text":"Greetings.","typed":true},"body":[{"uiType":"OutputText","group":"DefaultText","value":"I'm having technical issues and won't be able to continue this conversation."}],"takeControl":true,"score":0}.

 

Can anyone tell me instead of the answer why am I getting default text and Score 0?

Victor Chen
ServiceNow Employee
ServiceNow Employee

Feel free to ask this separately in our question forum. 

A_189
Giga Explorer

Having the same problem here. How do we forward the Virtual Agent chat response to the primary bot?

rajeshjain
Tera Expert

1) Is it possible to get Virtual agent plugin enabled without ITSM prof. as an individual/bundled plugin ?

2) If Virtual agent chat client is published on any 3rd part website then is there any additional licensing impact ?

Victor Chen
ServiceNow Employee
ServiceNow Employee

@rajeshjain 

1. No, you need a Professional/Enterprise license to use Virtual Agent, Virtual Agent API. With standard, you can still use VA Lite, but it has limited capabilities. 

2. No, if you have a Pro/Enterprise license, you're all set. If you're on Standard, you can also still embed VA in a 3rd party website but again with limited capabilities. 

rajeshjain
Tera Expert

Thank you.

Vinita Jain1
Tera Explorer

Do we need to configure Message_Auth  on sys_cs_provider_application record for Basic / Oauth Authentication?

REJINTALA PRASH
Tera Contributor

@Nabil Asbi   can you let me know how to connect Virtual agent to Genesys Pure cloud, where VA is Primary bot and Genesys Pure cloud as Secondary Bot?

Victor Chen
ServiceNow Employee
ServiceNow Employee

Our engineering team has created a great KB article on implementing a bot-to-bot integration with an Azure bot as the primary bot and ServiceNow Virtual Agent as the secondary bot - https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1436882

 

Ryjutr
Tera Explorer

Is there a solution to integrate SNVA to Genesys Live agent as secondary bot

Version history
Last update:
‎12-06-2023 04:35 PM
Updated by:
Contributors