{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":475,"path":"api-reference/rest-apis/bot-api.md","title":"Virtual Agent Bot Integration API","bundle":null,"doc_type":null,"release":"australia","body":"\n# Virtual Agent Bot Integration API\n\nThe 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.\n\nThis API is built on the conversational custom chat integration framework provided with Virtual Agent and operates in the `sn_va_as_service` namespace.\n\nFor additional information on installing and configuring the Virtual Agent Bot Integration API, see [Using Virtual Agent with a live agent](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/conversational-interfaces/using-va-agent-chat.md).\n\n**Parent Topic:**[REST API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/api-rest.md)\n\n## VA Bot Integration - POST /sn\\_va\\_as\\_service/bot/integration\n\nSends a specified message, attachment, or URL to a specified secondary ServiceNow Virtual Agent \\(VA\\) bot.\n\nA 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.\n\n**Note:** This endpoint can be either synchronous or asynchronous depending on how it's configured. If asynchronous, when the request is received by the endpoint, it validates the request and responds with a call status of success or failure and the appropriate HTTP status code. The VA then processes the request and sends a second response to the configured response endpoint. For example, for a bot-to-bot integration, the second response would be to the URL of your primary bot. Both of these responses are defined below. For additional information on this configured response endpoint, see Configure the output response REST endpoint and outbound authentication for the Virtual Agent API.\n\n**Note:** The responses in the code examples for this endpoint show what is sent from the VA to the configured response endpoint. They don't show the actual response to this endpoint which is a simple success or failure response.\n\n### URL format\n\nDefault URL: `/api/sn_va_as_service/bot/integration`\n\n### Supported request parameters\n\n|Name|Description|\n|----|-----------|\n|None| |\n\n|Name|Description|\n|----|-----------|\n|None| |\n\n<table id=\"vabot-req-parms\" class=\"rest_api_request_body\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\naction\n\n</td><td>\n\nAction that the VA should take.Valid values:\n\n-   [AGENT](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/bot-api.md): Switches the conversation from VA to Live Agent.\n-   [CREATE\\_CONVERSATION](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/bot-api.md): Creates a chat interaction. Set **syncResponse** to `true` to return the conversation and interaction details back in the response.\n-   [END\\_CONVERSATION](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/bot-api.md): Ends the chat conversation. The **message.text** parameter should be empty when using this action.\n-   [FAULT\\_CONVERSATION](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/bot-api.md): Faults a conversation. When setting a FAULT\\_CONVERSATION action, provide a description for the **cause** parameter.\n-   [SEND\\_HISTORY](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/bot-api.md): Updates only the chat history. The chat history can also be sent using standard message processing with the **history** parameter.\n-   SET\\_USER\\_TIMEZONE: Sets the user’s time zone to the time zone specified in the **timezone** parameter. This time zone remains in effect until you reset it using this same parameter.\n-   [START\\_CONVERSATION](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/bot-api.md): Starts a chat conversation.\n-   [START\\_CREATED\\_CONVERSATION](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/bot-api.md): Starts a chat conversation initiated using `CREATE_CONVERSATION`. Set **syncResponse** to `true` to process the request synchronously and avoid race conditions that cause timing issues.\n-   [SWITCH](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/bot-api.md): Switch the conversation to a topic that matches what is specified in the **intent.id** or **topic.name** parameters.\n\n**Note:** Only use the `SWITCH` action for topic switching when the intent discovery happens in the primary bot. If the intent discovery happens in the ServiceNow® VA, use the **message.text** parameter.\n\n-   TYPING/VIEWING: Displays the typing indicator in Live Agent. First send `TYPING` and then after the user finishes typing, send `VIEWING`.\n-   [UPDATE\\_MESSAGES](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/bot-api.md): This action is used during live agent conversations and provides two message update functions for third-party chat integrations for the messages received from the live agent that are reflected on the agent chat panel:\n\n    -   The latest message delivery status after sending a message from third-party.\n    -   Updated text on the agent chat panel.\nThe third-party chat integration can update the text portion of the message before sending it to the end user. This action can be called to update the text on the agent chat panel so that the agent can see the updated text with an \"Updated\" tag.\n\nThis action is used with the **message.status** and **message.id** parameters.\n\nThis option is only valid if custom adapter property with name third\\_party\\_chat tied to provider application is set to `true`. This is a synchronous action irrespective of synchronous/asynchronous nature of the channel.\n\n-   Null or parameter not passed: Sends the message to the ServiceNow VA.\n\nThe third-party chat integration can update the text message triggered from the live agent before sending it to the end user. This action can be called to update the text on the agent chat panel so that the agent can see the updated text with an \"Updated\" tag.\n\nData type: String\n\nDefault: Null\n\n</td></tr><tr><td>\n\nbotToBot\n\n</td><td>\n\nFlag that indicates whether the conversation is between bots, such as between a primary bot and secondary bot.Possible values:\n\n-   true: Bot-to-bot conversation.\n-   false: Standalone ServiceNow bot conversation.\n\nData type: Boolean\n\nDefault: true\n\n</td></tr><tr><td>\n\ncause\n\n</td><td>\n\nCause of a chat conversation fault, for example, `EXTERNAL_FAILURE`. This property is only used when the **action** property is set to **FAULT\\_CONVERSATION**.Data type: String\n\n</td></tr><tr><td>\n\nclientSessionId\n\n</td><td>\n\nUnique client session identifier of the application/service that the end user is using to communicate with the ServiceNow botor the supported third-party chat applications.-   This ID helps identify the set of request/responses for a specific user conversation.\n-   The format of this parameter is determined by the implementer.\n-   This value is only updated if the value of the **third\\_party\\_chat** field is `true` in the **Custom Adapter Property** form.\n\nTable: Interaction \\[interaction\\]\n\nData type: String\n\nDefault: Null\n\n</td></tr><tr><td>\n\nclientVariables\n\n</td><td>\n\nPass-through JSON-formatted name-value pairs that are sent back in the response. These values aren't processed by the endpoint, but can be used to keep specific customer information attached to the conversation.Data type: Object\n\nDefault: Null\n\n</td></tr><tr><td>\n\ncontextVariables\n\n</td><td>\n\nJSON-formatted name-value pairs that provide addition information about the user. Provide this information to customize the conversation experience. For additional information on context variables, see [Define and publish chat context variables](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/conversational-interfaces/ac-configure-context-variables.md).For example:\n\n```\n\"contextVariables\": {\n  \"requester_session_language\": \"es\", \n  \"deviceTimeZone\": \"America/Los_Angeles\"\n  \"live_agent_only\": \"true\",\n  \"liveagent_deviceType\": \"test_device_type\"\n  \"topic\": \"7c3c819073a3101066c7e9344ef6a7e4\" \n} \n```\n\nData type: Object\n\nDefault: Null\n\n</td></tr><tr><td>\n\nemailId\n\n</td><td>\n\nRequired when enabling account linking, otherwise all users are considered guest users. Email address of the chat client end user, the person the bot is interacting with. For additional information on account linking, see [Link your ServiceNow user account to a messaging application for Virtual Agent conversations](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/conversational-interfaces/link-accounts-with-virtual-agent.md).Data type: String\n\n</td></tr><tr><td>\n\nhistory\n\n</td><td>\n\nHistory of the primary bot’s conversation with the user, starting with the initial request by the user.Data type: Object\n\n```\n\"history\": {\n  \"displayName\": \"String\",\n  \"isBotMessage\": Boolean,\n  \"timestamp\": \"String\",\n  \"type\": \"String\",\n  \"value\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nhistory.displayName\n\n</td><td>\n\nName of the user to whom the message was sent. If the primary bot, pass `Bot`.Data type: String\n\n</td></tr><tr><td>\n\nhistory.isBotMessage\n\n</td><td>\n\nFlag that indicates whether the message was sent by the primary bot.Valid values:\n\n-   true: Message was sent by the primary bot.\n-   false: Message was sent by the user.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nhistory.timestamp\n\n</td><td>\n\nTimestamp indicating the time at which the message was sent in milliseconds.Valid values: 13-digit Unix timestamp\n\nData type: String\n\n</td></tr><tr><td>\n\nhistory.type\n\n</td><td>\n\nType of message sent.Valid values: text\n\nData type: String\n\n</td></tr><tr><td>\n\nhistory.value\n\n</td><td>\n\nContent of the information. For example, the message text.Data type: String\n\n</td></tr><tr><td>\n\nintent\n\n</td><td>\n\nDescribes the intent of the conversation. Provide this information when the **action** parameter is set to `SWITCH`.Data type: Object\n\n```\n\"intent\": {\n  \"id\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nintent.id\n\n</td><td>\n\nNLU Intent ID of the system topic to switch the conversation to. The **intent.id** is resolved based on the language passed in the chat session. If no language is passed when starting a conversation, it obtains the language from the user's session/profile.Data type: String\n\nTable: CS Topic Language \\[sys\\_cs\\_topic\\_language\\]\n\n</td></tr><tr><td>\n\nmessage\n\n</td><td>\n\nRequired. Details of the message to send to the ServiceNow bot.Data type: Object\n\n```\n\"message\": {\n  \"attachment\": [Array of Objects],\n  \"clientMessageId\": \"String\",\n  \"status\": \"String\",\n  \"text\": \"String\",\n  \"typed\": Boolean\n}\n```\n\n</td></tr><tr><td>\n\nmessage.attachment\n\n</td><td>\n\nRequired if sending attachments. Details of each attachment to send.You can only pass attachments as a URL. A virus scan is triggered on all attachments. There is no restriction on the size of an attachment, however, large files can take significant time to transfer.\n\nData type: Array of Objects\n\n```\n\"attachment\": [\n  {\n    \"clientAttachmentId\": \"String\",\n    \"contentType\": \"String\",\n    \"fileName\": \"String\",\n    \"headers\":{Object},\n    \"id\": \"String\",\n    \"url\": \"String\"\n  }\n]\n```\n\n</td></tr><tr><td>\n\nmessage.attachment.clientAttachmentId\n\n</td><td>\n\nUnique identifier of the attachment to send to the ServiceNow bot. The format of this identifier is determined by the implementer.Data type: String\n\nDefault: Null\n\n</td></tr><tr><td>\n\nmessage.attachment.contentType\n\n</td><td>\n\nRequired if attachment specified. Standard mime type of the attachment.Valid values \\(not case-sensitive\\):\n\n-   application/pdf\n-   application/msword\n-   image/png\n-   image/jpeg\n-   text/plain\n-   video/mpeg\n\nData type: String\n\n</td></tr><tr><td>\n\nmessage.attachment.fileName\n\n</td><td>\n\nRequired if attachment specified. File name of the attachment.Data type: String\n\n</td></tr><tr><td>\n\nmessage.attachment.headers\n\n</td><td>\n\nAdditional information needed if the attachment file is private and protected.Data type: Object\n\n```\n\"headers\":{\n  \"Authorization\":\"String\"\t\n}\n```\n\n</td></tr><tr><td>\n\nmessage.attachment.headers.Authorization\n\n</td><td>\n\nInformation needed to obtain authorization to access the attachment, such as a user name and password.Data type: String\n\n</td></tr><tr><td>\n\nmessage.attachment.url\n\n</td><td>\n\nRequired if attachment specified. URL where the attachment is located. The VA obtains the attachment from this URL, runs a virus scan, and then processes the file. If the attachment isn't a public file, you must pass an **message.attachment.header** object that contains the authorization information so that the attachment can be accessed. You must also ensure that URL domain is present in the trusted domains filed in **sys\\_cs\\_provider**.Data type: String\n\n</td></tr><tr><td>\n\nmessage.clientMessageId\n\n</td><td>\n\nUnique alphanumeric identifier for the message. The format of this identifier is determined by the implementer.Data type: String\n\nDefault: Null\n\n</td></tr><tr><td>\n\nmessage.id\n\n</td><td>\n\nOnly used with the **UPDATE\\_MESSAGES** action. Unique ID of the chat message to be updated.Data type: String\n\n</td></tr><tr><td>\n\nmessage.status\n\n</td><td>\n\nMessage status.Valid values \\(not case-sensitive\\):\n\n-   external\\_error - Used when message delivery is failed from third-party chat integration to end user. The agent chat panel will be reflected as a \"Failed\" tag.\n-   sent\\_to\\_user - Initially a single tick mark displays for messages delivered from live agent to third- party chat integration. This status must be used when the message is successfully delivered from third-party chat integration to the end user. Upon success, the double tick mark displays on the agent chat panel.\n\nData type: String\n\n</td></tr><tr><td>\n\nmessage.text\n\n</td><td>\n\nRequired if **attachment** parameter isn't specified. Message text. -   The language of the message should be passed in the **contextVariables** parameter.\n-   Must be empty if the value of the action property is `END_CONVERSATION`.\n-   Must be the updated text to be reflected on agent chat panel if the value of the action property is `UPDATE_MESSAGES`.\n\nData type: String\n\nMaximum length: Unlimited\n\n</td></tr><tr><td>\n\nmessage.typed\n\n</td><td>\n\nRequired. Flag that indicates whether the message was typed in or was an option selection \\(selected\\).Valid values:\n\n-   true: Message was typed in by the user.\n-   false: Message was an option selection.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nrequestId\n\n</td><td>\n\nRequired. Unique alphanumeric identifier for this request. The format of this identifier is determined by the implementer.Data type: String\n\n</td></tr><tr><td>\n\nsilentMessage\n\n</td><td>\n\nFlag that indicates whether this is a silent message. A silent message is a message that doesn’t require a response.Valid values:\n\n-   true: Silent message, no response message expected.\n-   false: Regular message, response message expected.\n\n**Note:** If a request with `silentMessage = true` is sent, all subsequent bot messages remain suppressed until a request to turn off silent mode is sent by passing `silentMessage = false`.\n\nData type: Boolean\n\nDefault: false\n\n</td></tr><tr><td>\n\nsyncResponse\n\n</td><td>\n\nApplicable for CREATE\\_CONVERSATION and START\\_CREATED\\_CONVERSATION actions. Flag that indicates whether to wait before returning a synchronous response from the API.\n\n**Note:** This parameter prevents a potential race condition where the `Work Offer` API could be triggered before the `CREATE_CONVERSATION` and `START_CREATED_CONVERSATION` request finished processing. Making the response synchronous eliminates this timing issue.\n\n Valid values:\n\n-   true: Returns a synchronous response.\n-   false: Returns a response without waiting.\n\n Default: false\n\n</td></tr><tr><td>\n\ntimestamp\n\n</td><td>\n\nUnix epoch time when the message was sent from the end user of the chat client.Data type: Number\n\nUnit: Milliseconds\n\nDefault: Current time\n\n</td></tr><tr><td>\n\ntimezone\n\n</td><td>\n\nGMT time zone of the end user of the chat client.For example:\n\n```\n\"timezone\":\"Asia/Kolkata\"\n```\n\nFor a list of the available time zone values, see [https://en.wikipedia.org/wiki/List\\_of\\_tz\\_database\\_time\\_zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).\n\nData type: String\n\nDefault: GMT time zone of the ServiceNow instance.\n\n</td></tr><tr><td>\n\ntopic\n\n</td><td>\n\nRequired if the user wants to switch to a particular topic by specifying a topic name. Name-value pair of the topic to switch to. You can either specify the topic name or the topic sys\\_id.**Note:** You can only specify a single topic name or ID in the object.\n\nData type: Object\n\n```\n\"topic\": {\n  \"name\": \"String\",\n  \"id\": \"String\"\n}\n```\n\nFor example:\n\n```\n{​ \n  \"requestId\": \"xxxx-xxxx-xxxx-xxxx\",​\n  \"clientSessionId\": \"xxx-xxx-xxx-xxx\",​\n  \"action\":\"SWITCH\",​\n  \"topic\":{​ \n    \"name\": \"Topic Name\"​\n  },​ \n  \"userId\": \"beth\"​ \n}​ \n```\n\n</td></tr><tr><td>\n\ntopic.name\n\n</td><td>\n\nName of the topic to switch to.Data type: String\n\nTable: In the name field of the Virtual Agent topics \\[sys\\_cs\\_topic\\] table.\n\n</td></tr><tr><td>\n\ntopic.id\n\n</td><td>\n\nSys\\_id of the topic to switch to.Data type: String\n\nTable: Virtual Agent topics \\[sys\\_cs\\_topic\\]\n\n</td></tr><tr><td>\n\nuserId\n\n</td><td>\n\nRequired. Unique user identifier. This is the identifier of the end user who is interacting with the bot.Data type: String\n\n</td></tr></tbody>\n</table>### Headers\n\nThe 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](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n<table class=\"rest_api_request_headers\"><thead><tr><th>\n\nHeader\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nAccept\n\n</td><td id=\"accept-JSON-only-entry-RESTAPI\">\n\nData format of the response body. Only supports **application/json**.\n\n</td></tr><tr><td>\n\nContent-Type\n\n</td><td id=\"content_type-JSON-only-entry-RESTAPI\">\n\nData format of the request body. Only supports **application/json**.\n\n</td></tr><tr><td>\n\ntoken\n\n</td><td>\n\nRequired 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\n\n</td></tr></tbody>\n</table>|Header|Description|\n|------|-----------|\n|None| |\n\n### Status codes\n\nThe 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](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n<table><thead><tr><th>\n\nStatus code\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\n200\n\n</td><td>\n\nSuccessful. The request was successfully processed.If you receive a 200 status code, but don’t receive a response back, check the following things:\n\n-   Whether the request is failing in Static, JWT, or Hash Based Token validation, which generally happens in the worker thread of Virtual Agent.​\n-   Whether the request body format is correct. If incorrect, the conversion doesn’t happen correctly.\n-   Whether the request body is missing some required parameters. You can trace exceptions and errors in the System Logs on the ServiceNow instance.\n-   Whether the site defined in the REST Message to receive the response is operational; able to detect in logs.\n-   Ensure the REST Message that defines where to post the response is set correctly.\n\n</td></tr><tr><td>\n\n400\n\n</td><td id=\"entry-400-status-code\">\n\nBad Request. A bad request type or malformed request was detected.\n\n</td></tr><tr><td>\n\n401\n\n</td><td id=\"entry-401-status-code\">\n\nUnauthorized. The user credentials are incorrect or have not been passed.\n\n</td></tr><tr><td>\n\n405\n\n</td><td id=\"entry-405-status-code\">\n\nInvalid method. The functionality is disabled.\n\n</td></tr><tr><td>\n\n500\n\n</td><td id=\"entry-500-status-code\">\n\nInternal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.\n\n</td></tr></tbody>\n</table>### Response body parameters\n\nStatus of the endpoint call. This is sent in response when the initial call request is received. The request hasn’t yet been processed.\n\n<table><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nerror\n\n</td><td>\n\nDescription of the detected error. Only returned if an error occurs.Data type: Object\n\n```\n\"error\": {\n  \"detail\": \"String\",\n  \"message\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nerror.detail\n\n</td><td>\n\nDetails about the encountered error.Data type: String\n\n</td></tr><tr><td>\n\nerror.message\n\n</td><td>\n\nError message thrown.Data type: String\n\n</td></tr><tr><td>\n\nstatus\n\n</td><td>\n\nStatus of the endpoint call.Valid values:\n\n-   failure\n-   success\n\nData type: String\n\n</td></tr></tbody>\n</table>### VA response body parameters\n\nResponse body sent from the VA to the configured response endpoint.\n\n<table id=\"table_bql_jkx_zmb\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nagentChat\n\n</td><td>\n\nFlag that indicates whether the conversation is connected to the ServiceNow Live Agent.Possible values:\n\n-   true: Chat messages are coming from a live agent.\n-   false: Chat messages are coming from a bot and this parameter isn’t returned in the response.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nbody\n\n</td><td>\n\nList of objects that describe the elements of the response message body.Data type: Array of Objects\n\n```\n\"body\": [\n  {\n    \"actionType\": \"String\",\n    \"agentInfo\": {Object},\n    \"data\": \"String\",\n    \"group\": \"String\",\n    \"header\": \"String\",\n    \"height\": Number,\n    \"itemType\": \"String\",\n    \"label\": \"String\",\n    \"maskType\": \"String\",\n    \"maxCount\": Number,\n    \"maxSize\": Number,\n    \"message\": \"String\",\n    \"messageId\": \"String\",\n    \"multiSelect\": Boolean,\n    \"nluTextEnabled\": Boolean,\n    \"options\": {Object},\n    \"promptMsg\": \"String\",\n    \"required\": Boolean,\n    \"style\": \"String\",\n    \"templateName\": \"String\",\n    \"type\": \"String\",\n    \"uiType\": \"String\",\n    \"value\": \"String/{Object}\",\n    \"width\": Number\n  }\n]\n```\n\n</td></tr><tr><td>\n\nbody.actionType\n\n</td><td>\n\nType of action message dispatched by the secondary bot to the primary bot. For example, typing indicator or agent wait time.Possible values:\n\n-   EndTypingIndicator\n-   StartSpinner\n-   StartTypingIndicator\n\nFor example:\n\nSending `StartTypeIndicator` to the primary bot when the typing indicator is enabled.\n\n```\n\"body\": {​ \n  \"uiType\":\"ActionMsg\",​ \n  \"actionType\":\"StartTypingIndicator\"​ \n}  \n```\n\nSending `StartSpinner` when transferring to Live Agent to display the wait time to the end user.\n\n```\n\"body\": { \n  \"uiType\":\"ActionMsg\", \n  \"actionType\":\"StartSpinner\", \n  \"spinnerType\":\"wait_time\",  \n  \"message\":\"Routing you to a live agent...\", \n  \"waitTime\":\"8 Seconds\" \n} \n```\n\nData type: String\n\n</td></tr><tr><td>\n\nbody.agentInfo\n\n</td><td>\n\nIf enabled in the agent chat setup, the name and avatar of the associated agent. Data type: Object\n\n```\n\"agentInfo\":{   \n  \"agentAvatar\":\"String\",\n  \"agentId\":\"String\",\n  \"agentName\": \"String\", \n  \"sentFromAgent\": Boolean\n}\n```\n\nFor example:\n\n```\n\"agentInfo\":{ \n  \"sentFromAgent\": true,\n  \"agentName\":\"Beth Anglin\", \n  \"agentAvatar\":\"https://instance.servicenow.com/ee4eebf30a0004d963b5c5ac0d734dc4.iix?t=small\" \n} \n```\n\n</td></tr><tr><td>\n\nbody.agentInfo.agentAvatar\n\n</td><td>\n\nURL of the agent's associated avatar file.For example: \"https://instance.servicenow.com/ee4eebf30a0004d963b5c5ac0d734dc4.iix?t=small\"\n\nData type: String\n\n</td></tr><tr><td>\n\nbody.agentInfo.agentId\n\n</td><td>\n\nThe sys\\_id of the live agent.Table: Live Profile \\[live\\_profile\\]\n\nData type: String\n\n</td></tr><tr><td>\n\nbody.agentInfo.agentName\n\n</td><td>\n\nDisplay name of the agent.Data type: String\n\n</td></tr><tr><td>\n\nbody.agentInfo.sentFromAgent\n\n</td><td>\n\nFlag that indicates whether the message was sent by a live agent.Possible values:\n\n-   true: Sent by a live agent.\n-   false: Sent by a virtual agent.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nbody.data\n\n</td><td>\n\nJSON string that defines the data within the card.Data type: String\n\n</td></tr><tr><td>\n\nbody.group\n\n</td><td>\n\nRich control group to which the body element belongs. You can further transform these default controls by writing outbound transformation scripts. For additional information on these scripts, see [Virtual Agent action scripts](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/conversational-interfaces/va-action-scripts.md).Possible values:\n\n-   DefaultOutputCard\n-   DefaultDate\n-   DefaultGroupedPartsOutputControl\n-   DefaultHtml\n-   DefaultOutputImage\n-   DefaultOutputLink\n-   DefaultText\n-   DefaultPicker\n\nData type: String\n\n</td></tr><tr><td>\n\nbody.header\n\n</td><td>\n\nLink header.Data type: String\n\n</td></tr><tr><td>\n\nbody.height\n\n</td><td>\n\nHeight of the HTML element.Data type: Number\n\nUnit: Pixels\n\n</td></tr><tr><td>\n\nbody.itemType\n\n</td><td>\n\nType of body element.Possible values: \\(case-sensitive\\)\n\n-   DefaultText\n    -   File\n    -   Image\n    -   Inputtext\n    -   outputtext\n-   DefaultPicker\n    -   Picture: Items appear in a carousel.\n    -   List: Items appear in a dropdown-style list.\n\nData type: String\n\n</td></tr><tr><td>\n\nbody.label\n\n</td><td>\n\nLabel to display for the associated element.Data type: String\n\n</td></tr><tr><td>\n\nbody.maskType\n\n</td><td>\n\nSensitivity of the associated data.Possible values:\n\n-   NONE: Associated data is of a general nature and doesn’t need to be secured.\n-   SECURE: Associated data is of a sensitive nature and should be handled securely.\n\nData type: String\n\n</td></tr><tr><td>\n\nbody.maxCount\n\n</td><td>\n\nOnly returned when **uiType** is `FileUpload`. Maximum number of attachments that can be uploaded at one time.Data type: Number \\(Integer\\)\n\n</td></tr><tr><td>\n\nbody.maxSize\n\n</td><td>\n\nOnly returned when **uiType** is `FileUpload`. Maximum size of the attachment that can be uploaded.Data type: Number \\(Integer\\)\n\nUnit: Megabytes\n\n</td></tr><tr><td>\n\nbody.message\n\n</td><td>\n\nOnly returned when **actionType** is `StartSpinner`. Message to display to user.Data type: String\n\n</td></tr><tr><td>\n\nbody.messageId\n\n</td><td>\n\nUnique identifier for the message sent to the supported third-party chat applications from the ServiceNow Virtual Agent.Table: Conversation Message \\[sys\\_cs\\_message\\]\n\nData type: String\n\n</td></tr><tr><td>\n\nbody.multiSelect\n\n</td><td>\n\nFlag that indicates whether the user can select multiple options.Possible values:\n\n-   true: Multiple selections.\n-   false: Single selection.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nbody.nluTextEnabled\n\n</td><td>\n\nFlag that indicates whether the user chat client can receive Natural Language Understanding \\(NLU\\) text messages.Possible values:\n\n-   true: Can receive NLU messages.\n-   false: Can’t receive NLU messages.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nbody.options\n\n</td><td>\n\nList that describes the options available for a picker control.Data type: Array of Objects\n\n```\n\"options\": [\n  {\n    \"attachment\": \"String\",\n    \"description\": \"String\",\n    \"enabled\": Boolean,\n    \"label\": \"String\",\n    \"renderStyle\": \"String\",\n    \"value\": \"String\"\n  }\n]\n```\n\n</td></tr><tr><td>\n\nbody.options.attachment\n\n</td><td>\n\nURL of the image in the carousel to retrieve.Data type: String\n\n</td></tr><tr><td>\n\nbody.options.description\n\n</td><td>\n\nDescription of the carousel item.Data type: String\n\n</td></tr><tr><td>\n\nbody.options.enabled\n\n</td><td>\n\nFlag that indicates whether the picker control is enabled on the end user's chat client. In bot-to-bot implementations, the primary bot is responsible for ensuring the picker control is disabled.Possible values:\n\n-   true: Enabled\n-   false: Disabled\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nbody.options.label\n\n</td><td>\n\nLabel to display for the associated **body.options.value** parameter.Data type: String\n\n</td></tr><tr><td>\n\nbody.options.renderStyle\n\n</td><td>\n\nStyle to use when rendering the associated element.Possible value: data\n\nData type: String\n\n</td></tr><tr><td>\n\nbody.options.value\n\n</td><td>\n\nValue to display for the associated **body.options.label** parameter.Data type: String\n\n</td></tr><tr><td>\n\nbody.promptMsg\n\n</td><td>\n\nPrompt message to display with the picker control.Data type: String\n\n</td></tr><tr><td>\n\nbody.required\n\n</td><td>\n\nFlag that indicates whether the end user must respond to the query in the body element.Possible values:\n\n-   true: Required\n-   false: Optional\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nbody.spinnerType\n\n</td><td>\n\nOnly returned when **actionType** is `StartSpinner`. Type of spinner shown to chat user.Possible values:\n\n`wait_time:` Message indicating the amount of delay before being transferred to a live agent.\n\nData type: String\n\n</td></tr><tr><td>\n\nbody.style\n\n</td><td>\n\nStyle of body element.Possible values:\n\n-   button\n-   carousel\n-   list\n-   null\n\nData type: String\n\n</td></tr><tr><td>\n\nbody.templateName\n\n</td><td>\n\nName of the template to use to display the associated card.Data type: String\n\n</td></tr><tr><td>\n\nbody.type\n\n</td><td>\n\nOnly returned for DefaultOutputLink. Type of return data.Possible values: link\n\nData type: String\n\n</td></tr><tr><td>\n\nbody.uiType\n\n</td><td>\n\nType of body element. The possible values depend on the value in the **body.group** parameter. These values map back to the controls defined in the Virtual Agent Designer. For more information, see [Getting started with Virtual Agent Designer](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/conversational-interfaces/conversation-designer-virtual-agent.md).Possible values:\n\n-   ActionMsg\n-   DefaultOutputCard\n\nOutputCard\n\n-   DefaultDate\n    -   Date\n    -   DateTime\n    -   Time\n-   DefaultGroupedPartsOutputControl\n\nGroupedPartsOutputControl\n\n-   DefaultHtml\n\nOutputHtml\n\n-   DefaultOutputImage\n\nOutputImage\n\n-   DefaultOutputLink\n\nOutputLink\n\n-   DefaultText\n    -   InputText\n    -   OutputText\n    -   FileUpload\n-   DefaultPicker\n    -   Picker\n    -   TopicPickerControl\n    -   Boolean\n\nData type: String\n\n</td></tr><tr><td>\n\nbody.value\n\n</td><td>\n\nData to use to process the body element. The type of information that is passed back depends on the type of body element.OutputLink: Object.\n\n```\n\"value\": {\n  \"action\": \"String\"\n}\n```\n\nOutputImage: String. Image URL.\n\nOutputHtml: String. HTML that the client needs to render.\n\nData type: String or Object\n\n</td></tr><tr><td>\n\nbody.value.action\n\n</td><td>\n\nOnly returned for DefaultOutputLink. URL of returned link.Data type: String\n\n</td></tr><tr><td>\n\nbody.waitTime\n\n</td><td>\n\nAmount of time that the user has to wait before being connected to a live agent.Data type: String\n\n</td></tr><tr><td>\n\nbody.width\n\n</td><td>\n\nWidth of the associated HTML element.Data type: Number\n\nUnit: Pixels\n\n</td></tr><tr><td>\n\nclientSessionId\n\n</td><td>\n\nUnique client session identifier of the chat application/service that the end user is using to communicate with the ServiceNow bot.Data type: String\n\n</td></tr><tr><td>\n\nclientVariables\n\n</td><td>\n\nJSON-formatted name-value pairs that are copied from what is passed in the **clientVariables** parameter in the request body. These values aren’t processed by the endpoint, but can be used to keep specific customer information attached to the conversation.Data type: Object\n\n</td></tr><tr><td>\n\ncompleted\n\n</td><td>\n\nFlag that indicates whether the ServiceNow Virtual Agent has successfully completed the conversation.Possible values:\n\n-   true: Conversation has been successfully completed.\n-   false: Conversation isn’t complete and this parameter isn’t returned in the response.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nenterpriseId\n\n</td><td>\n\nCurrently unused.\n\n</td></tr><tr><td>\n\ninteractionId\n\n</td><td>\n\nUnique identifier for each conversation between the ServiceNow Virtual Agent and the supported third-party chat applications.Data type: String\n\n</td></tr><tr><td>\n\nmessage\n\n</td><td>\n\nDetails of the message sent to the ServiceNow VA. This is the same as the passed in message object.Data type: Object\n\n```\n\"message\": {\n  \"attachment\": {Object},\n  \"clientMessageId\": \"String\",\n  \"text\": \"String\",\n  \"typed\": Boolean\n}\n```\n\n</td></tr><tr><td>\n\nmessage.attachment\n\n</td><td>\n\nDetails of the attachment. Attachments can be either a file or a URL.Data type: Object\n\n```\n\"attachment\": {\n  \"clientAttachmentId\": \"String\",\n  \"contentType\": \"String\",\n  \"fileName\": \"String\",\n  \"url\": \"String\"\n```\n\n</td></tr><tr><td>\n\nmessage.attachment.clientAttachmentId\n\n</td><td>\n\nUnique identifier of the attachment sent to the ServiceNow VA. The format of this identifier is determined by the implementer.Data type: String\n\n</td></tr><tr><td>\n\nmessage.attachment.contentType\n\n</td><td>\n\nStandard mime type of the attachment.Possible values \\(not case-sensitive\\):\n\n-   application/msword\n-   application/pdf\n-   image/jpeg\n-   image/png\n-   text/plain\n-   video/mpeg\n\nData type: String\n\n</td></tr><tr><td>\n\nmessage.attachment.fileName\n\n</td><td>\n\nFile name of the attachment.Data type: String\n\n</td></tr><tr><td>\n\nmessage.attachment.url\n\n</td><td>\n\nURL where the attachment is located.Data type: String\n\n</td></tr><tr><td>\n\nmessage.clientMessageId\n\n</td><td>\n\nUnique alphanumeric identifier for the message.Data type: String\n\n</td></tr><tr><td>\n\nmessage.text\n\n</td><td>\n\nMessage text.Data type: String\n\nMaximum length: Unlimited\n\n</td></tr><tr><td>\n\nmessage.typed\n\n</td><td>\n\nFlag that indicates whether the message was typed in or was an option selection \\(selected\\).Possible values:\n\n-   true: Message was typed in by the user.\n-   false: Message was an option selection.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nnowBotId\n\n</td><td>\n\nCurrently unused.\n\n</td></tr><tr><td>\n\nnowSessionId\n\n</td><td>\n\nCurrently unused.\n\n</td></tr><tr><td>\n\nrequestId\n\n</td><td>\n\nUnique identifier for this request.Data type: String\n\n</td></tr><tr><td>\n\nscore\n\n</td><td>\n\nIntent confidence score from the ServiceNow NLU model, specified as a percent, such as 87.3%. This score enables the primary bot to make the decision whether to surface the associated intent based on the primary bot’s NLU model’s confidence threshold. The ServiceNow NLU model’s confidence threshold is ignored on the ServiceNow instance so that the primary bot’s NLU model’s confidence threshold can be consistently applied across all secondary bots.Data type: Number\n\n</td></tr><tr><td>\n\ntakeControl\n\n</td><td>\n\nFlag that indicates that the ServiceNow Virtual Agent wants to hand control back over to the primary bot.Possible values:\n\n-   true: Return control to the primary bot.\n-   false: Keep control.\n\nData type: Boolean\n\nDefault: false\n\n</td></tr><tr><td>\n\nuserId\n\n</td><td>\n\nIdentifier of the end user who is interacting with the bot.Data type: String\n\n</td></tr></tbody>\n</table>### Start a conversation using the START\\_CONVERSATION action\n\nThe following example shows how to use the [START\\_CONVERSATION](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/bot-api.md) action to start a conversation with Virtual Agent. This call directs the user to the greeting topic.\n\n```\ncurl \"https://instance.servicenow.com/api/sn_va_as_service/bot/integration\" \\\n--request POST \\\n--header \"Accept:application/json\" \\\n--header \"Content-Type:application/json\" \\\n--data \"{ \n  \"requestId\": \"asd2423-sda23-qwe23-we23\", \n  \"action\": \"START_CONVERSATION\", \n  \"enterpriseId\": \"ServiceNow\", \n  \"nowBotId\": \"A85PWLERF\", \n  \"clientSessionId\": \"\", \n  \"nowSessionId\": \"\",\n  \"message\":{ \n    \"text\": \"\", \n    \"typed\": true, \n    \"clientMessageId\": \"ABC-123\" \n  }, \n  \"userId\": \"beth.anglin\", \n  \"emailId\": \"beth.anglin@example.com\", \n  \"timestamp\": 1588824102, \n  \"timezone\": \"America/New_York\" \n}\"\n--user \"username\":\"password\"\n\n```\n\nThe following is the response body sent from the VA to the configured response endpoint.\n\n```\n{ \n  \"requestId\":\"asd2423-sda23-qwe23-we23\", \n  \"clientSessionId\":\"\", \n  \"nowSessionId\":\"\", \n  \"message\":{ \n    \"text\":\"\", \n    \"typed\":true, \n    \"clientMessageId\":\"ABC-123\" \n  },\n  \"userId\":\"beth.anglin\", \n  \"body\":[ \n    { \n      \"uiType\":\"OutputText\", \n      \"group\":\"DefaultText\", \n      \"value\":\"Hi, I'm your Virtual Agent. Let me know how I can help you today.\", \n      \"maskType\":\"NONE\" \n    },\n    { \n      \"uiType\":\"TopicPickerControl\", \n      \"group\":\"DefaultPicker\", \n      \"nluTextEnabled\":false, \n      \"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.\", \n      \"label\":\"Show me everything\", \n      \"options\":[ \n        { \n          \"label\":\"b2b topic\", \n          \"value\":\"2bb7bd7670de6010f877c7f188266fc7\", \n          \"enabled\":true \n        }, \n        { \n           \"label\":\"Live Agent Support.\", \n           \"value\":\"ce2ee85053130010cf8cddeeff7b12bf\", \n           \"enabled\":true \n        } \n      ] \n    }\n  ],\n  \"score\":1 \n} \n```\n\n### Create a chat interaction\n\nThe following example shows how to use the [CREATE\\_CONVERSATION](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/bot-api.md) action to create a chat interaction.\n\n```\ncurl \"https://instance.servicenow.com/api/sn_va_as_service/bot/integration\" \\\n--request POST \\\n--header \"Accept:application/json\" \\\n--header \"Content-Type:application/json\" \\\n--data \"{\n  \"requestId\": \"f42f3550-5b44-4cde-aa52-9b6756b3131c\",\n  \"clientSessionId\": \"\",\n  \"action\": \"CREATE_CONVERSATION\",\n  \"message\": {\n    \"text\": \"hi\",\n    \"typed\": false\n  },\n  \"userId\": \"abel.tuter\",\n  \"emailId\": \"abel.tuter@example.com\"\n}\"\n--user \"username\":\"password\"\n\n```\n\nThe following is the response body sent from the VA to the configured response endpoint.\n\n```\n{\n  \"requestId\": \"f42f3550-5b44-4cde-aa52-9b6756b3131c\",\n  \"clientSessionId\": \"\",\n  \"message\": {\n    \"text\": \"hi\",\n    \"typed\": false\n  },\n  \"userId\": \"abel.tuter\",\n  \"interactionId\": \"240c91c8fd9f2e50f877c29ac5fbe8ed\",\n  \"body\": [\n    {\n      \"uiType\": \"ActionMsg\",\n      \"actionType\": \"CreateConversation\",\n      \"conversationId\": \"a40c91c8fd9f2e50f877c29ac5fbe8eb\",\n      \"interactionId\": \"240c91c8fd9f2e50f877c29ac5fbe8ed\",\n      \"messageId\": \"b80c91c8fd9f2e50f877c29ac5fbe8f8\"\n    }\n  ],\n  \"score\": 1\n}\n```\n\n### Start a synchronous CREATE\\_CONVERSATION conversation\n\nThe following example initiates a new Virtual Agent conversation with the [CREATE\\_CONVERSATION](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/bot-api.md) action and waits for a synchronous response before returning. The **syncResponse** parameter is set to `true`, indicating that the API should respond synchronously.\n\n```\ncurl \"https://instance.servicenow.com/api/sn_va_as_service/bot/integration\" \\\n  --request POST \\\n  --header \"Accept:application/json\" \\\n  --header \"Content-Type:application/json\" \\\n  --data '{\n    \"requestId\": \"f42f3550-5b44-4cde-aa52-9b6756b31eee\",\n    \"userId\": \"first.last\",\n    \"emailId\": \"first.last@example.com\",\n    \"action\": \"CREATE_CONVERSATION\",\n    \"syncResponse\": true,\n    \"message\": {},\n    \"contextVariables\": {\n      \"live_agent_only\": \"true\",\n      \"interaction_client_session_id\": \"externalId123456575\"\n    },\n    \"appInboundId\": \"NT\"\n  }' \\\n  --user \"username\":\"password\"\n```\n\nResponse body:\n\n```\n{\n  \"requestId\": \"f42f3550-5b44-4cde-aa52-9b6756b31eee\",\n  \"message\": {},\n  \"userId\": \"first.last\", \n  \"appInboundId\": \"NT\",\n  \"body\": [\n    {\n      \"uiType\": \"ActionMsg\",\n      \"actionType\": \"CreateConversation\",\n      \"conversationId\": \"113927672fe7be10b252672bcfa4e353\",\n      \"interactionId\": \"9d3923a72fe7be10b252672bcfa4e3c4\",\n      \"messageId\": \"553923a72fe7be10b252672bcfa4e3e0\"\n    }\n  ],\n  \"score\": 1\n}\n```\n\n### Start a conversation initiated using the START\\_CREATED\\_CONVERSATION action\n\nThe following example shows how to start a chat conversation that has been initiated using the [START\\_CREATED\\_CONVERSATION](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/bot-api.md) action.\n\n```\ncurl \"https://instance.servicenow.com/api/sn_va_as_service/bot/integration\" \\\n--request POST \\\n--header \"Accept:application/json\" \\\n--header \"Content-Type:application/json\" \\\n--data \"{\n  \"requestId\": \"f42f3550-5b44-4cde-aa52-9b6756b3131c\",\n  \"clientSessionId\": \"\",\n  \"action\": \"START_CREATED_CONVERSATION\",\n  \"userId\": \"abel.tuter\",\n  \"emailId\": \"abel.tuter@example.com\"\n}\"\n--user \"username\":\"password\"\n\n```\n\nThe following is the response body sent from the VA to the configured response endpoint.\n\n```\n{ \n  \"requestId\":\"302bas2be70-sadsa-we32-3eq2-1231ra9\", \n  \"clientSessionId\":\"\",\n  \"message\":{ \n    \"text\":\"hola\", \n    \"typed\":true\n  }, \n  \"userId”:”abel.tuter\", \n  \"body\":[\n    { \n      \"uiType\":\"OutputText\", \n      \"group\":\"DefaultText\",\n      \"value\":\"Hi, I'm your Virtual Agent. Let me know how I can help you today.\",\n      \"maskType\":\"NONE\"\n    },\n    { \n      \"uiType\":\"TopicPickerControl\", \n      \"group\":\"DefaultPicker\",\n      \"nluTextEnabled\":false,\n      \"promptMsg\":\"Hi guest, please enter your request or make a selection of what I can help with. You can type hellllp! any time when you need help.\", \n      \"label\":\"Show me everything\",\n      \"options\":[\n        {\n          \"label\":\"boolean check\",\n          \"value\":\"1b5257a1db712010d3d6d9595e9619f3\",\n          \"enabled\":true\n        },\n        { \n          \"label\":\"Test_table_datepicker\",\n          \"value\":\"6515f0cadb4220108249f7541d961980\",\n          \"enabled\":true\n        }, \n        { \n          \"label\":\"Test File upload\",\n          \"value\":\"76c1f4b2db7520108249f7541d9619a7\",\n          \"enabled\":true\n        },\n        { \n          \"label\":\"Test B2B 2\",\n          \"value\":\"8373e55cdb8120108249f7541d96196d\",\n          \"enabled\":true\n        },\n        {\n          \"label\":\"FAQ Conversation Builder_Global\",\n          \"value\":\"9f3114a3dbc520108249f7541d961981\",\n          \"enabled\":true\n        },\n        {\n          \"label\":\"Get to know you\",\n          \"value\":\"a443dd6adb812010d3d6d9595e961954\", \n          \"enabled\":true\n        }, \n        { \n          \"label\":\"Get to know you_Global\", \n          \"value\":\"b1a56b87db8120108249f7541d9619b2\", \n          \"enabled\":true \n        },\n        {\n          \"label\":\"Live Agent Support.\",\n          \"value\":\"ce2ee85053130010cf8cddeeff7b12bf\",\n          \"enabled\":true\n        },\n        {\n          \"label\":\"Apply for PTO_B2B NLU\",\n          \"value\":\"d948c94cdb052010d3d6d9595e961969\",\n          \"enabled\":true \n        }\n      ]\n    } \n   ], \n   \"score\":1 \n} \n```\n\n### Start a synchronous START\\_CREATED\\_CONVERSATION conversation\n\nThis example initiates the [START\\_CREATED\\_CONVERSATION](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/bot-api.md) action and waits for a synchronous response before returning. The **syncResponse** parameter is set to `true`, indicating that the API should respond synchronously with the conversation details.\n\n```\ncurl \"https://instance.servicenow.com/api/sn_va_as_service/bot/integration\" \\\n  --request POST \\\n  --header \"Accept:application/json\" \\\n  --header \"Content-Type:application/json\" \\\n  --data '{\n  \"requestId\": \"f42f3550-5b44-4cde-aa52-9b6756b31eee\",\n  \"userId\": \"first.last\",\n  \"emailId\": \"first.last@example.com\",\n  \"action\": \"START_CREATED_CONVERSATION\",\n  \"syncResponse\": true,\n  \"message\": {},\n  \"appInboundId\": \"NT\"\n  }' \\\n  --user \"username\":\"password\"\n```\n\nResponse body:\n\n```\n{\n  \"requestId\": \"f42f3550-5b44-4cde-aa52-9b6756b31eee\",\n  \"message\": {},\n  \"userId\": \"first.last\",\n  \"appInboundId\": \"NT\",\n  \"body\": [\n    {\n      \"uiType\": \"ActionMsg\",\n      \"actionType\": \"StartConversation\",\n      \"conversationId\": \"113927672fe7be10b252672bcfa4e353\",\n      \"messageId\": \"6989aba72fe7be10b252672bcfa4e3b2\"\n    },\n    {\n      \"uiType\": \"ActionMsg\", \n      \"actionType\": \"SubscribeToSupportQueue\",\n      \"supportQueue\": \"{@type=InteractionQueue, external=false, type=interaction, queueAmbChannel=/cs/support_queue/c3lzX2lkPW51bGw=}\",\n      \"messageId\": \"a989aba72fe7be10b252672bcfa4e3d6\"\n    },\n    {\n      \"uiType\": \"ActionMsg\",\n      \"actionType\": \"StartSpinner\",\n      \"spinnerType\": \"none\",\n      \"message\": \"Routing you to a live agent...\",\n      \"waitTime\": \"13 Seconds\",\n      \"messageId\": \"b189aba72fe7be10b252672bcfa4e3da\"\n    },\n    {\n      \"uiType\": \"ActionMsg\",\n      \"actionType\": \"SubscribeToChatPresence\",\n      \"channel\": \"/sn/rp/sys_cs_conversation/113927672fe7be10b252672bcfa4e353\",\n      \"userDetails\": \"{name=Guest, sysId=5136503cc611227c0183e96598c4f706, avatarPath=null, displayName=Guest, initials=G, showNameInHeader=false, userName=guest, email=guest@example.com, channel=null}\",\n      \"chatSessionId\": \"113927672fe7be10b252672bcfa4e353\",\n      \"messageId\": \"7189aba72fe7be10b252672bcfa4e3f0\"\n    }\n  ],\n  \"agentChat\": true,\n  \"score\": 1\n}\n```\n\n### Fault a conversation using\n\nThe following example shows how to using the [FAULT\\_CONVERSATION](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/bot-api.md) action and setting the value of the **cause** parameter.\n\n```\ncurl \"https://instance.servicenow.com/api/sn_va_as_service/bot/integration\" \\\n--request POST \\\n--header \"Accept:application/json\" \\\n--header \"Content-Type:application/json\" \\\n--data \"{\n  \"requestId\": \"f42f3550-5b44-4cde-aa52-9b6756b3131c\",\n  \"clientSessionId\": \"\",\n  \"action\": \"FAULT_CONVERSATION\",\n  \"cause\": \"EXTERNAL_FAILURE\",\n  \"userId\": \"abel.tuter\",\n  \"emailId\": \"abel.tuter@example.com\"\n}\"\n--user \"username\":\"password\"\n\n```\n\nThe following is the response body sent from the VA to the configured response endpoint.\n\n```\n{\n  \"requestId\": \"f42f3550-5b44-4cde-aa52-9b6756b3131c\",\n  \"clientSessionId\": \"\",\n  \"userId\": \"abel.tuter\",\n  \"body\": [],\n  \"takeControl\": true,\n  \"score\": 0\n}\n```\n\n### Update the message on the agent chat panel\n\nThe [UPDATE\\_MESSAGES](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/bot-api.md) action is used during live agent conversations and is used to reflect message updates on agent chat panel from third party chat integrations. This action can accept a list of messages and updates for all the messages can be done in a single run.\n\n```\ncurl \"https://instance.servicenow.com/api/sn_va_as_service/bot/integration\" \\\n--request POST \\\n--header \"Accept:application/json\" \\\n--header \"Content-Type:application/json\" \\\n--data \"{\n  \"requestId\": \"f42f3550-5b44-4cde-aa52-9b6756b3131c\",\n  \"clientSessionId\": \"\",\n  \"message\": [\n    {\n      \"status\": \"external_error\",\n      \"id\": \"54623afeff762210efa1ffffffffff77\"\n    }\n  ],\n  \"userId\": \"abel.tuter\",\n  \"emailId\": \"abel.tuter@example.com\",\n  \"action\": \"UPDATE_MESSAGES\"\n}\"\n--user \"username\":\"password\"\n```\n\nThe following is the response message sent from the VA to the configured response endpoint.\n\n```\nMessage Processed Successfully\n```\n\n### Update only chat history\n\nThe following example shows how to use the [SEND\\_HISTORY](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/bot-api.md) action to update only chat history.\n\n```\ncurl \"https://instance.servicenow.com/api/sn_va_as_service/bot/integration\" \\\n--request POST \\\n--header \"Accept:application/json\" \\\n--header \"Content-Type:application/json\" \\\n--data \"{\n  \"requestId\": \"f42f3550-5b44-4cde-aa52-9b6756b3131c\",\n\"clientSessionId\": \"\",\n  \"userId\": \"abel.tuter\",\n  \"emailId\": abel.tuter@example.com,\n  \"action\": \"SEND_HISTORY\",\n  \"history\": [\n    {\n      \"isBotMessage\": true,\n      \"value\": \"How can I help you?\",\n      \"displayName\": \"Genesys Bot\",\n      \"type\": \"text\",\n      \"timestamp\": \"1739866290393\"\n    },\n    {\n      \"isBotMessage\": false,\n      \"value\": \"I am facing an issue while creating an incident.\",\n      \"displayName\": \"User\",\n      \"type\": \"text\",\n      \"timestamp\": \"1739877357223\"\n    },\n    {\n      \"isBotMessage\": true,\n      \"value\": \"Okay. i am routing you to an agent\",\n      \"displayName\": \"Genesys Bot\",\n      \"type\": \"text\",\n      \"timestamp\": \"1739877409746\"\n    },\n    {\n      \"isBotMessage\": false,\n      \"value\": \"Thanks.\",\n      \"displayName\": \"User\",\n      \"type\": \"text\",\n      \"timestamp\": \"1739877453201\"\n    }\n  ]\n}\"\n--user \"username\":\"password\"\n```\n\nThe following is the success response sent from the VA to the configured response endpoint.\n\n```\n{\"status\": \"success\"}\n```\n\n### Transfer a conversation to Live Agent using utterance\n\nThe 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](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/conversational-interfaces/contextual-actions.md).\n\n```\ncurl \"https://instance.servicenow.com/api/sn_va_as_service/bot/integration\" \\\n--request POST \\\n--header \"Accept:application/json\" \\\n--header \"Content-Type:application/json\" \\\n--header \"token: ORANGE\" \\\n--data \" {\n  \"requestId\": \"322bas2be70-sadsa-we32-3eq2-1231ra9\",\n  \"botToBot\": true,\n  \"clientSessionId\": \"\",\n  \"silentMessage\": false,\n  \"message\":{\n    \"text\": \"agent\",\n    \"typed\": true\n  },\n  \"userId\": \"abel.tuter\",\n  \"emailId\": \"abel.tuter@servicenow.com\",\n  \"timestamp\": 1588824102,\n  \"timezone\": \"America/New_York\"\n}\"\n```\n\nThe following is the response body sent from the VA to the configured response endpoint.\n\n```\n{\n  \"requestId\":\"322bas2be70-sadsa-we32-3eq2-1231ra9\",\n  \"clientSessionId\":\"\",\n  \"message\":{\n    \"text\":\"agent\",\n    \"typed\":true\n  },\n  \"userId\":\"abel.tuter\",\n  \"body\":[\n    {\n      \"uiType\":\"Picker\",\n      \"group\":\"DefaultPicker\",\n      \"required\":true,\n      \"nluTextEnabled\":false,\n      \"label\":\"I want to be sure I got this right. What item best describes what you want to do?\",\n      \"itemType\":\"List\",\n      \"style\":\"list\",\n      \"multiSelect\":false,\n      \"options\":[\n        {\n          \"label\":\"Live Agent Support.\",\n          \"value\":\"Live Agent Support.\",\n          \"renderStyle\":\"data\",\n          \"enabled\":false\n        },\n        {\n          \"label\":\"Virtual Agent Capabilities.\",\n          \"value\":\"Virtual Agent Capabilities.\",\n          \"renderStyle\":\"data\",\n          \"enabled\":false\n        },\n        {\n          \"label\":\"I want something else\",\n          \"value\":\"-1\",\n          \"renderStyle\":\"data\",\n          \"enabled\":false\n        }\n      ],\n      \"scriptedData\":null\n    }\n  ],\n  \"score\":1\n}\n```\n\n### Transfer a conversation to Live Agent Support based on the user's selection\n\nThe following example shows transferring the conversation to Live Agent Support based on the user's selection from the prior interaction.\n\n```\ncurl \"https://instance.servicenow.com/api/sn_va_as_service/bot/integration\" \\\n--request POST \\\n--header \"Accept:application/json\" \\\n--header \"Content-Type:application/json\" \\\n--header \"token: ORANGE\" \\\n--data \"{\n  \"requestId\": \"322bas2be70-sadsa-we32-3eq2-1231ra9\",\n  \"botToBot\": true,\n  \"clientSessionId\": \"\",\n  \"silentMessage\": false,\n  \"message\":{\n    \"text\": \"Live Agent Support.\",\n    \"typed\": true\n  },\n  \"userId\": \"abel.tuter\",\n  \"emailId\": \"abel.tuter@servicenow.com\",\n  \"timestamp\": 1588824102,\n  \"timezone\": \"America/New_York\"\n} \"\n```\n\nThe following is the response body sent from the VA to the configured response endpoint.\n\n```\n{\n  \"requestId\":\"322bas2be70-sadsa-we32-3eq2-1231ra9\",\n  \"clientSessionId\":\"\",\n  \"message\":{\n    \"text\":\"Live Agent Support.\",\n    \"typed\":true\n  },\n  \"userId\":\"abel.tuter\",\n  \"body\":[\n    {\n      \"uiType\":\"OutputText\",\n      \"group\":\"DefaultText\",\n      \"value\":\"Please stand by while I connect you to a live agent.\"\n    }\n  ],\n  \"agentChat\":true,\n  \"score\":1\n}\n```\n\n### End a Virtual Agent conversation by setting the action parameter\n\nThe following example shows how to end a Virtual Agent conversation by setting the **action** parameter to [END\\_CONVERSATION](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/bot-api.md).\n\n```\ncurl \"https://instance.servicenow.com/api/sn_va_as_service/bot/integration\" \\\n--request POST \\\n--header \"Accept:application/json\" \\\n--header \"Content-Type:application/json\" \\\n--data \"{\n  \"requestId\": \"s345ew-sjg554-qwe23-we23\",\n  \"action\": \"END_CONVERSATION\",\n  \"enterpriseId\": \"ServiceNow\",\n  \"nowBotId\": \"A85PWLERF\",\n  \"clientSessionId\": \"\",\n  \"nowSessionId\": \"\",\n  \"message\":{\n    \"text\": \"b2b topic\",\n    \"typed\": true,\n    \"clientMessageId\": \"ABC-123\"\n  },\n  \"userId\": \"beth.anglin\",\n  \"emailId\": beth.anglin@example.com,\n  \"timestamp\": 1588824102,\n  \"timezone\": \"America/New_York\"\n}\"\n--user \"username\":\"password\"\n\n```\n\nThe following is the response body sent from the VA to the configured response endpoint showing the conversation ended.\n\n```\n{\n  \"requestId\":\"s345ew-sjg554-qwe23-we23\",\n  \"clientSessionId\":\"\",\n  \"nowSessionId\":\"\",\n  \"message\":{\n    \"text\":\"\",\n    \"typed\":true,\n    \"clientMessageId\":\"ABC-123\"\n  },\n  \"userId\":\"beth.anglin\",\n  \"body\":[\n    {\n      \"uiType\":\"OutputText\",\n      \"group\":\"DefaultText\",\n      \"value\":\"The conversation has ended. If you need help again, type hi.\",\n      \"maskType\":\"NONE\"\n    }\n  ],\n  \"score\":1\n}\n```\n\n### End a Live Agent conversation by setting the action parameter\n\nThe following example shows how to end a Live Agent conversation by setting the **action** parameter to [END\\_CONVERSATION](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/bot-api.md).\n\n```\ncurl \"https://instance.servicenow.com/api/sn_va_as_service/bot/integration\" \\\n--request POST \\\n--header \"Accept:application/json\" \\\n--header \"Content-Type:application/json\" \\\n--data \"{\n  \"requestId\": \"sad-sjg554-qwe23-we23\",\n  \"action\": \"END_CONVERSATION\",\n  \"enterpriseId\": \"ServiceNow\",\n  \"nowBotId\": \"A85PWLERF\",\n  \"clientSessionId\": \"\",\n  \"nowSessionId\": \"\",\n  \"message\":{\n    \"text\": \"\",\n    \"typed\": true,\n    \"clientMessageId\": \"ABC-123\"\n  },\n  \"userId\": \"beth.anglin\",\n  \"emailId\": \"beth.anglin@example.com\",\n  \"timestamp\": 1588824102,\n  \"timezone\": \"America/New_York\"\n}\"\n--user \"username\":\"password\"\n\n```\n\nThe following is the response body sent from the VA to the configured response endpoint showing the conversation ended.\n\n```\n{\n  \"requestId\":\"sad-sjg554-qwe23-we23\",\n  \"clientSessionId\":\"\",\n  \"nowSessionId\":\"\",\n  \"message\":{\n    \"text\":\"\",\n    \"typed\":true,\n    \"clientMessageId\":\"ABC-123\"\n  },\n  \"userId\":\"beth.anglin\",\n  \"body\":[\n    {\n      \"uiType\":\"OutputText\",\n      \"group\":\"DefaultText\",\n      \"value\":\"The conversation has ended. If you need help again, type hi.\",\n      \"maskType\":\"NONE\"\n    }\n  ],\n  \"completed\":true,\n  \"score\":1\n}\n```\n\n### Use commands defined in the sys\\_cs\\_contextual\\_action table as an utterance to start a conversation with Virtual Agent\n\nThe 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\".\n\n```\ncurl \"https://instance.servicenow.com/api/sn_va_as_service/bot/integration\" \\\n--request POST \\\n--header \"Accept:application/json\" \\\n--header \"Content-Type:application/json\" \\\n--header \"token: ORANGE\" \\\n--data \"{\n  \"requestId\": \"302bas2be70-sadsa-we32-3eq2-1231ra9\",\n  \"botToBot\": true,\n  \"clientSessionId\": \"\",\n  \"silentMessage\": false,\n  \"message\":{\n    \"text\": \"hola\",\n    \"typed\": true\n  },\n  \"userId\": \"fred.ludy\",\n  \"emailId\": \"abel.tuter@servicenow.com\",\n  \"timestamp\": 1588824102,\n  \"timezone\": \"America/New_York\"\n}\"\n```\n\nThe following is the response body sent from the VA to the configured response endpoint.\n\n```\n{ \n  \"requestId\":\"302bas2be70-sadsa-we32-3eq2-1231ra9\", \n  \"clientSessionId\":\"\",\n  \"message\":{ \n    \"text\":\"hola\", \n    \"typed\":true\n  }, \n  \"userId\":\"fred.ludy\", \n  \"body\":[\n    { \n      \"uiType\":\"OutputText\", \n      \"group\":\"DefaultText\",\n      \"value\":\"Hi, I'm your Virtual Agent. Let me know how I can help you today.\",\n      \"maskType\":\"NONE\"\n    },\n    { \n      \"uiType\":\"TopicPickerControl\", \n      \"group\":\"DefaultPicker\",\n      \"nluTextEnabled\":false,\n      \"promptMsg\":\"Hi guest, please enter your request or make a selection of what I can help with. You can type hellllp! any time when you need help.\", \n      \"label\":\"Show me everything\",\n      \"options\":[\n        {\n          \"label\":\"boolean check\",\n          \"value\":\"1b5257a1db712010d3d6d9595e9619f3\",\n          \"enabled\":true\n        },\n        { \n          \"label\":\"Test_table_datepicker\",\n          \"value\":\"6515f0cadb4220108249f7541d961980\",\n          \"enabled\":true\n        }, \n        { \n          \"label\":\"Test File upload\",\n          \"value\":\"76c1f4b2db7520108249f7541d9619a7\",\n          \"enabled\":true\n        },\n        { \n          \"label\":\"Test B2B 2\",\n          \"value\":\"8373e55cdb8120108249f7541d96196d\",\n          \"enabled\":true\n        },\n        {\n          \"label\":\"FAQ Conversation Builder_Global\",\n          \"value\":\"9f3114a3dbc520108249f7541d961981\",\n          \"enabled\":true\n        },\n        {\n          \"label\":\"Get to know you\",\n          \"value\":\"a443dd6adb812010d3d6d9595e961954\", \n          \"enabled\":true\n        }, \n        { \n          \"label\":\"Get to know you_Global\", \n          \"value\":\"b1a56b87db8120108249f7541d9619b2\", \n          \"enabled\":true \n        },\n        {\n          \"label\":\"Live Agent Support.\",\n          \"value\":\"ce2ee85053130010cf8cddeeff7b12bf\",\n          \"enabled\":true\n        },\n        {\n          \"label\":\"Apply for PTO_B2B NLU\",\n          \"value\":\"d948c94cdb052010d3d6d9595e961969\",\n          \"enabled\":true \n        }\n      ]\n    } \n   ], \n   \"score\":1 \n} \n```\n\n### Use commands defined in the sys\\_cs\\_contextual\\_action table as an utterance to end a conversation\n\nThe 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\".\n\n```\ncurl \"https://instance.servicenow.com/api/sn_va_as_service/bot/integration\" \\\n--request POST \\\n--header \"Accept:application/json\" \\\n--header \"Content-Type:application/json\" \\\n--header \"token: ORANGE\" \\\n--data \"{\n  \"requestId\": \"302bas2be70-sadsa-we32-3eq2-1231ra9\",\n  \"botToBot\": true,\n  \"clientSessionId\": \"\",\n  \"silentMessage\": false,\n  \"message\":{\n    \"text\": \"choa\",\n    \"typed\": true\n  },\n  \"userId\": \"fred.ludy\",\n  \"emailId\": \"abel.tuter@servicenow.com\",\n  \"timestamp\": 1588824102,\n  \"timezone\": \"America/New_York\"\n}\"\n```\n\nThe following is the response body sent from the VA to the configured response endpoint.\n\n```\n{\n  \"requestId\":\"302bas2be70-sadsa-we32-3eq2-1231ra9\",\n  \"clientSessionId\":\"\",\n  \"message\":{ \n    \"text\":\"chao\",\n    \"typed\":true\n  }, \n  \"userId\":\"fred.ludy\",\n  \"body\":[ \n    {\n      \"uiType\":\"Picker\",\n      \"group\":\"DefaultPicker\",\n      \"required\":true,\n      \"nluTextEnabled\":false,\n      \"label\":\"Please make a selection.\",\n      \"itemType\":\"List\",\n      \"style\":\"list\",\n      \"multiSelect\":false,\n      \"options\":[\n        {\n          \"label\":\"End conversation\",\n          \"value\":\"1\",\n          \"renderStyle\":\"data\",\n          \"enabled\":false\n        }, \n        {\n          \"label\":\"Cancel\",\n          \"value\":\"0\",\n          \"renderStyle\":\"data\",\n          \"enabled\":false\n        } \n      ],\n      \"scriptedData\":null \n    }\n  ],\n  \"score\":1 \n}\n```\n\n### Change an ongoing conversation using the SWITCH action parameter\n\nThe following example shows how to use the [SWITCH](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/bot-api.md) **action** parameter to change an ongoing conversation to the topic that matches what is specified in the **intent.id** parameter.\n\n```\ncurl \"https://instance.servicenow.com/api/sn_va_as_service/bot/integration\" \\\n--request POST \\\n--header \"Accept:application/json\" \\\n--header \"Content-Type:application/json\" \\\n--data \"{\n  \"requestId\": \"sdfsfs-hgfhg-34fssd-zxcz-sd43\",\n  \"enterpriseId\": \"ServiceNow\",\n  \"nowBotId\": \"A85PWLERF\",\n  \"clientSessionId\": \"\",\n  \"nowSessionId\": \"\",\n  \"action\": \"SWITCH\",\n  \"intent\" : {\n    \"id\": \"Saloon Vehicle\"\n  },\n  \"message\":{\n    \"typed\": true,\n    \"clientMessageId\": \"ABC-123\"\n  },\n  \"userId\": \"Guest\",\n  \"timestamp\": 1588824102,\n  \"timezone\": \"America/New_York\"\n}\"\n--user \"username\":\"password\"\n\n```\n\nThe following is the response body sent from the VA to the configured response endpoint showing the VA switched to the new topic.\n\n```\n{\n   \"requestId\":\"sdfsfs-hgfhg-34fssd-zxcz-sd43\",\n   \"clientSessionId\":\"\",\n   \"nowSessionId\":\"\",\n   \"message\":{\n      \"typed\":true,\n      \"clientMessageId\":\"ABC-123\"\n   },\n   \"userId\":\"Guest\",\n   \"body\":[\n      {\n         \"uiType\":\"InputText\",\n         \"group\":\"DefaultText\",\n         \"required\":true,\n         \"nluTextEnabled\":false,\n         \"label\":\"limo input:\",\n         \"maskType\":\"NONE\"\n      }\n   ],\n   \"score\":1\n}\n```\n\n### Obtain a Natural Language Understanding \\(NLU\\) confidence score for an utterance\n\nThe following example shows how to obtain a NLU confidence score for an utterance if NLU is enabled in VA.\n\n```\ncurl \"https://instance.servicenow.com/api/sn_va_as_service/bot/integration\" \\\n--request POST \\\n--header \"Accept:application/json\" \\\n--header \"Content-Type:application/json\" \\\n--data \"{\n  \"requestId\": \"sdfsfs-hgfhg-34fssd-zxcz-sd43\", \n  \"enterpriseId\": \"ServiceNow\", \n  \"nowBotId\": \"A85PWLERF\", \n  \"clientSessionId\": \"\", \n  \"nowSessionId\": \"\", \n  \"message\":{ \n    \"text\": \"most popular choice\", \n    \"typed\": true, \n    \"clientMessageId\": \"ABC-123\" \n  }, \n  \"userId\": \"Guest\", \n  \"timestamp\": 1588824102, \n  \"timezone\": \"America/New_York\" \n}\"\n--user \"username\":\"password\"\n\n```\n\nThe following is the response body sent from the VA to the configured response endpoint showing the NLU confidence score.\n\n```\n{ \n  \"requestId\":\"sdfsfs-hgfhg-34fssd-zxcz-sd43\", \n  \"clientSessionId\":\"\", \n  \"nowSessionId\":\"\", \n  \"message\":{ \n    \"text\":\"most popular choice\", \n    \"typed\":true, \n    \"clientMessageId\":\"ABC-123\" \n  }, \n  \"userId\":\"Guest\", \n  \"body\":[ \n    { \n      \"uiType\":\"InputText\", \n      \"group\":\"DefaultText\", \n      \"required\":true, \n      \"nluTextEnabled\":false, \n      \"label\":\"model input:\", \n      \"maskType\":\"NONE\" \n    }\n  ], \n  \"score\":\"0.92\" \n}\n```\n\n### Transfer a conversation to Live Agent in a specific queue\n\nThe 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. This example uses the [AGENT](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/bot-api.md) action parameter. For additional information on creating a work item queue, see [Create a work item queue](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/conversational-interfaces/awa-create-queue.md).\n\n```\ncurl \"https://instance.servicenow.com/api/sn_va_as_service/bot/integration\" \\\n--request POST \\\n--header \"Accept:application/json\" \\\n--header \"Content-Type:application/json\" \\\n--data \"{\n  \"requestId\": \"34re-dasd-qwe23-dsds\", // Unique value for a message (hash)\n  \"enterpriseId\": \"ServiceNow\", // ServiceNow (Optional\n  \"nowBotId\": \"A85PWLERF\", // In case of multiple ServiceNow secondary bots (one for HR, one for ITSM)\n  \"action\":\"AGENT\", // Actions to close conversation. Other possible value is END_CONVERSATION\n  \"clientSessionId\": \"\", // Client conversation id\n  \"nowSessionId\": \"\", // ServiceNow conversation id\n  \"message\":{\n    \"text\": \"How are you?\", // User passed message\n    \"typed\": true, // typed or clicked\n    \"clientMessageId\": \"ABC-123\"\n  },\n  \"userId\": \"abraham.lincoln\", // User’s id in their system\n  \"emailId\": \"abraham.lincoln@example.com\",\n  \"timestamp\": 1588824102,\n  \"timezone\": \"America/New_York\",\n  \"contextVariables\":{\n    \"b2b_category\":\"humanresource\"\n  } \n}\"\n--user \"username\":\"password\"\n\n```\n\nThe following is the response body sent from the VA to the configured response endpoint.\n\n```\n{\n  \"requestId\":\"34re-dasd-qwe23-dsds\",\n  \"clientSessionId\":\"\",\n  \"nowSessionId\":\"\",\n  \"message\":{\n    \"text\":\"How are you?\",\n    \"typed\":true,\n    \"clientMessageId\":\"ABC-123\"\n   },\n   \"userId\":\"abraham.lincoln\",\n   \"body\":[\n     {\n       \"uiType\":\"OutputText\",\n       \"group\":\"DefaultText\",\n       \"value\":\"I am sorry but I didn't understand your request.\",\n       \"maskType\":\"NONE\"\n    },\n    {\n      \"uiType\":\"OutputText\",\n      \"group\":\"DefaultText\",\n      \"value\":\"Please try giving me your request in a different way. I'm currently better at understanding short sentences.\",\n      \"maskType\":\"NONE\"\n    },\n    {\n      \"uiType\":\"TopicPickerControl\",\n      \"group\":\"DefaultPicker\",\n      \"nluTextEnabled\":false,\n      \"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.\",\n      \"label\":\"Show me everything\",\n      \"options\":[\n        {\n          \"label\":\"Live Agent Support.\",\n          \"value\":\"ce2ee85053130010cf8cddeeff7b12bf\",\n          \"enabled\":true\n        }\n      ]\n    }\n  ],\n  \"score\":0\n}\n```\n\n### Transfer a public application/pdf attachment file\n\nThis example shows how to transfer a public application/pdf attachment.\n\n```\ncurl \"https://instance.servicenow.com/api/sn_va_as_service/bot/integration\" \\\n--request POST \\\n--header \"Accept:application/json\" \\\n--header \"Content-Type:application/json\" \\\n--header \"token: BOT_Token\" \\\n--data \"{\n  \"requestId\": \"f42f3550-5b44-4cde-aa52-9b6756b3131c\",\n  \"clientSessionId\": \"U94CSJLEN\",\n  \"message\": {\n    \"attachment\": {\n    \"clientAttachmentId\": \"my-unique-identifier\",\n    \"contentType\": \"application/pdf\",\n    \"fileName\": \"MY PDF TEST\",\n    \"url\": \"http://www.africau.edu/images/default/sample.pdf\"\n    }\n  },\n  \"userId\": \"U94CSJLEN\",\n  \"emailId\": \"admin@example.com\"\n}\"\n--user \"username\":\"password\"\n\n```\n\nThe following is the response body sent from the VA to the configured response endpoint.\n\n```\n{\n  \"requestId\":\"f42f3550-5b44-4cde-aa52-9b6756b3131c\",\n  \"clientSessionId\":\"U94CSJLEN\",\n  \"message\":{\n    \"attachment\":{\n      \"clientAttachmentId\":\"my-unique-identifier\",\n      \"contentType\":\"application/pdf\",\n      \"fileName\":\"MY PDF TEST\",\n      \"url\":\"http://www.africau.edu/images/default/sample.pdf\"}\n    },\n    \"userId\":\"U94CSJLEN\",\n    \"body\":[\n      {\n        \"uiType\":\"OutputText\",\n        \"group\":\"DefaultText\",\n        \"required\":false,\n        \"nluTextEnabled\":false,\n        \"label\":\"File got\",\n        \"maskType\":\"NONE\",\n        \"itemType\":\"outputtext\"\n      },\n      {\n        \"uiType\":\"OutputText\",\n        \"group\":\"DefaultText\",\n        \"required\":false,\n        \"nluTextEnabled\":false,\n        \"label\":\"The conversation has ended. If you need help again, type hi.\",\n        \"maskType\":\"NONE\",\n        \"itemType\":\"outputtext\"\n       }\n    ],\n  \"completed\":true,\n  \"score\":1\n}\n```\n\n### Transfer a video/mpeg attachment\n\nThis example shows the request/response for uploading a video/mpeg attachment.\n\n```\ncurl \"https://instance.servicenow.com/api/sn_va_as_service/bot/integration\" \\\n--request POST \\\n--header \"Accept:application/json\" \\\n--header \"Content-Type:application/json\" \\\n--header \"token: BOT_TOKEN\" \\\n--data \"{\n  \"requestId\": \"f42f3550-5b44-4cde-aa52-9b6756b3131c\",\n  \"clientSessionId\": \"U94CSJLEN\",\n  \"message\": {\n    \"attachment\": {\n    \"clientAttachmentId\": \"my-unique-identifier10\",\n    \"contentType\": \"video/mpeg\",\n    \"fileName\": \"MY TEST10.mp4\",\n    \"url\": \"https://sample-videos.com/video123/mp4/720/big_buck_bunny_720p_1mb.mp4\"\n    }\n  },\n  \"userId\": \"U94CSJLEN\",\n  \"emailId\": \"admin@example.com\"\n}\"\n--user \"username\":\"password\"\n\n```\n\nThe following is the response body sent from the VA to the configured response endpoint.\n\n```\n{\n  \"requestId\":\"f42f3550-5b44-4cde-aa52-9b6756b3131c\",\n  \"clientSessionId\":\"U94CSJLEN\",\n  \"message\":{\n    \"attachment\":{\n      \"headers\":{\n        \"Authorization\":\"Basic amFzbWluZS53YWRod2FuaWE6VGVzdGluZ0AxMjM=\"\n      },\n      \"clientAttachmentId\":\"my-unique-identifier10\",\n      \"contentType\":\"video/mpeg\",\n      \"fileName\":\"MY TEST10.mp4\",\n      \"url\":\"https://sample-videos.com/video123/mp4/720/big_buck_bunny_720p_1mb.mp4\"\n    }\n  },\n  \"userId\":\"U94CSJLEN\",\n  \"body\":[\n    {\n      \"uiType\":\"OutputText\",\n      \"group\":\"DefaultText\",\n      \"required\":false,\n      \"nluTextEnabled\":false,\n      \"label\":\"File got\",\n      \"maskType\":\"NONE\",\n      \"itemType\":\"outputtext\"\n    },\n    {\n      \"uiType\":\"OutputText\",\n      \"group\":\"DefaultText\",\n      \"required\":false,\n      \"nluTextEnabled\":false,\n      \"label\":\"The conversation has ended. If you need help again, type hi.\",\n      \"maskType\":\"NONE\",\"itemType\":\"outputtext\"\n    }\n  ],\n  \"completed\":true,\n  \"score\":1\n}\n```\n\n### Transfer a image/jpeg attachment\n\nThis example shows the request/response for uploading a image/jpeg attachment.\n\n```\ncurl \"https://instance.servicenow.com/api/sn_va_as_service/bot/integration\" \\\n--request POST \\\n--header \"Accept:application/json\" \\\n--header \"Content-Type:application/json\" \\\n--header \"token: BOT_TOKEN\" \\\n--data \"{\n  \"requestId\": \"f42f3550-5b44-4cde-aa52-9b6756b3131c\",\n  \"clientSessionId\": \"U94CSJLEN\",\n  \"message\": {\n    \"attachment\": {\n      \"clientAttachmentId\": \"my-unique-identifier10\",\n      \"contentType\": \"image/jpeg\",\n      \"fileName\": \"MY TEST10.jpg\",\n      \"url\": \"https://image.imagestock.com/image-photo/pink-butterfly-isolated-on-white-260nw-1218104047.jpg\"\n    }\n  },\n  \"userId\": \"U94CSJLEN\",\n  \"emailId\": \"admin@example.com\"\n}\"\n--user \"username\":\"password\"\n\n```\n\nThe following is the response body sent from the VA to the configured response endpoint.\n\n```\n{\n  \"requestId\":\"f42f3550-5b44-4cde-aa52-9b6756b3131c\",\n  \"clientSessionId\":\"U94CSJLEN\",\n  \"message\":{\n    \"attachment\":{\n      \"headers\":{\n        \"Authorization\":\"Basic amFzbWluZS53YWRod2FuaWE6VGVzdGluZ0AxMjM=\"\n      },\n      \"clientAttachmentId\":\"my-unique-identifier10\",\n      \"contentType\":\"image/jpeg\",\n      \"fileName\":\"MY TEST10.jpg\",\n      \"url\":\"https://image.imagestock.com/image-photo/pink-butterfly-isolated-on-white-260nw-1218104047.jpg\"\n    }\n  },\n  \"userId\":\"U94CSJLEN\",\n  \"body\":[\n    {\n      \"uiType\":\"OutputText\",\n      \"group\":\"DefaultText\",\n      \"required\":false,\n      \"nluTextEnabled\":false,\n      \"label\":\"File got\",\n      \"maskType\":\"NONE\",\n      \"itemType\":\"outputtext\"\n    },\n    {\n      \"uiType\":\"OutputText\",\n      \"group\":\"DefaultText\",\n      \"required\":false,\n      \"nluTextEnabled\":false,\n      \"label\":\"The conversation has ended. If you need help again, type hi.\",\n      \"maskType\":\"NONE\",\n      \"itemType\":\"outputtext\"\n    }\n  ],\n  \"completed\":true,\n  \"score\":1\n}\n```\n\n"}}