Virtual Agent Bot Integration API
-
- UpdatedJan 30, 2025
- 21 minutes to read
- Yokohama
- API reference
The Virtual Agent Bot Integration API provides endpoints that allow users to integrate any chat interface or a bot ecosystem with the ServiceNow Virtual Agent and/or Live Agent.
This API is built on the conversational custom chat integration framework provided with Virtual Agent and operates in the sn_va_as_service
namespace.
For additional information on installing and configuring the Virtual Agent Bot Integration API, see Virtual Agent API.
VA Bot Integration - POST /sn_va_as_service/bot/integration
Sends a specified message, attachment, or URL to a specified secondary ServiceNow Virtual Agent (VA) bot.
A customer's site can have one or more secondary ServiceNow bots. In addition to passing messages to a ServiceNow VA secondary bot, the primary bot or chat client can use this endpoint to pass messages to an agent through Live Agent chat. Use the action parameter passed in the request body to specify how the specified content should be handled.
URL format
Default URL: /api/sn_va_as_service/bot/integration
Supported request parameters
Name | Description |
---|---|
None |
Name | Description |
---|---|
None |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response body. Only supports application/json. |
Content-Type | Data format of the request body. Only supports application/json. |
token | Required if using token-based authentication; optional for Basic or OAuth authentication. Authentication token to use if token authentication has been set up for this endpoint. Data type: String |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Response body parameters
Status of the endpoint call. This is sent in response when the initial call request is received. The request hasn’t yet been processed.
VA response body parameters
Response body sent from the VA to the configured response endpoint.
Example: Start a conversation using the START_CONVERSATION action to start a conversation
The following example shows how to use the START_CONVERSATION action to start a conversation with Virtual Agent. This call directs the user to the greeting topic.
The following is the response body sent from the VA to the configured response endpoint.
Example: Transfer a conversation to Live Agent using utterance
The following example illustrates how to transfer a conversation to Live Agent, bypassing the greeting topic, by passing agent
as an utterance in the
message.text parameter. Possible utterance values are defined in the
sys_cs_contextual_action table. For additional information on contextual actions, see Contextual actions for custom chat
integrations.
The following is the response body sent from the VA to the configured response endpoint.
Example: Transfer a conversation to Live Agent Support based on the user's selection
The following example shows transferring the conversation to Live Agent Support based on the user's selection from the prior interaction.
The following is the response body sent from the VA to the configured response endpoint.
Example: End a Virtual Agent conversation by setting the action parameter
The following example shows how to end a Virtual Agent conversation by
setting the action parameter to END_CONVERSATION
.
The following is the response body sent from the VA to the configured response endpoint showing the conversation ended.
Example: End a Live Agent conversation by setting the action parameter
The following example shows how to end a Live Agent conversation by setting
the action parameter to END_CONVERSATION
.
The following is the response body sent from the VA to the configured response endpoint showing the conversation ended.
Example: Use commands defined in the sys_cs_contextual_action table as an utterance to start a conversation with Virtual Agent
The following example shows how to use the Hi command defined in the
sys_cs_contextual_action table as an utterance to start a conversation with Virtual Agent instead of setting the action parameter to
START_CONVERSATION
as shown in prior examples. This example shows using
one of the language variants of the Hi command, "hola".
The following is the response body sent from the VA to the configured response endpoint.
Example: Use commands defined in the sys_cs_contextual_action table as an utterance to end a conversation
The following example shows how to use the Bye command defined in the
sys_cs_contextual_action table as an utterance to end a conversation with Virtual Agent instead of setting action to
END_CONVERSATION
as shown in prior examples. This example shows using one
of the language variants of the Bye command, "choa".
The following is the response body sent from the VA to the configured response endpoint.
Example: Change an ongoing conversation using the SWITCH action parameter
The following example shows how to use the SWITCH
action parameter to change an ongoing conversation to the topic that
matches what is specified in the intent.id parameter.
The following is the response body sent from the VA to the configured response endpoint showing the VA switched to the new topic.
Example: Obtain a Natural Language Understanding (NLU) confidence score for an utterance
The following example shows how to obtain a NLU confidence score for an utterance if NLU is enabled in VA.
The following is the response body sent from the VA to the configured response endpoint showing the NLU confidence score.
Example: Transfer a conversation to Live Agent in a specific queue
The following example shows how to transfer a conversation to Live Agent in a specific queue. You must first set up your queues with specific conditions. You then pass those conditions as contextVariables in the request body. For additional information on creating a work item queue, see Create a work item queue.
The following is the response body sent from the VA to the configured response endpoint.
Example: Transfer a public application/pdf attachment file
This example shows how to transfer a public application/pdf attachment.
The following is the response body sent from the VA to the configured response endpoint.
Example: Transfer a video/mpeg attachment
This example shows the request/response for uploading a video/mpeg attachment.
The following is the response body sent from the VA to the configured response endpoint.
Example: Transfer a image/jpeg attachment
This example shows the request/response for uploading a image/jpeg attachment.
The following is the response body sent from the VA to the configured response endpoint.
On this page
- VA Bot Integration - POST /sn_va_as_service/bot/integration
- URL format
- Supported request parameters
- Headers
- Status codes
- Response body parameters
- VA response body parameters
- Example: Start a conversation using the START_CONVERSATION action to start a
conversation
- Example: Transfer a conversation to Live Agent using utterance
- Example: Transfer a conversation to Live Agent Support based on the user's selection
- Example: End a Virtual Agent conversation by setting the action parameter
- Example: End a Live Agent conversation by setting the action parameter
- Example: Use commands defined in the sys_cs_contextual_action table as an utterance to start a
conversation with Virtual Agent
- Example: Use commands defined in the sys_cs_contextual_action table as an utterance to end a
conversation
- Example: Change an ongoing conversation using the SWITCH action parameter
- Example: Obtain a Natural Language Understanding (NLU) confidence score
for an utterance
- Example: Transfer a conversation to Live Agent in a specific queue
- Example: Transfer a public application/pdf attachment file
- Example: Transfer a video/mpeg attachment
- Example: Transfer a image/jpeg attachment
- URL format