{"id":48040,"date":"2022-10-04T18:03:35","date_gmt":"2022-10-04T17:03:35","guid":{"rendered":"https:\/\/developer.kore.ai\/v10-1\/?p=48040"},"modified":"2023-01-30T07:42:01","modified_gmt":"2023-01-30T07:42:01","slug":"travel-va-configuring-agent-transfer","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/how-tos\/travel-planing-assistant\/travel-va-configuring-agent-transfer\/","title":{"rendered":"Travel VA: Configuring Agent Transfer"},"content":{"rendered":"<p><span style=\"font-weight: 400\">One of the frequently asked questions is how to transfer a conversation to a human agent from a Virtual Assistant. This is especially necessary if your VA is in the space of customer service. Virtual Assistants are not meant to completely replace humans. Many times the assistant will fail to answer satisfactorily or the user would just want to talk\/conversation to a human from the beginning. When this happens the assistant should transfer the conversation to a human agent.<\/span><\/p>\n<p><span style=\"font-weight: 400\">In this article, we will provide an overview of how we can integrate a live conversation into our VA using <\/span><strong>Kore.ai Agent Transfer<\/strong><span style=\"font-weight: 400\">. The source code for the Agent Transfer is available at Kore.ai github repo: <\/span><a href=\"https:\/\/github.com\/Koredotcom\/BotKit\"><span style=\"font-weight: 400\">https:\/\/github.com\/Koredotcom\/BotKit<\/span><\/a>.<\/p>\n<table style=\"width: 100%;border-collapse: collapse;background-color: #fffbea\">\n<tbody>\n<tr>\n<td style=\"width: 100%\"><strong>Note<\/strong><span style=\"font-weight: 400\">: The configuration and steps listed on this page are guidelines only. The steps may have changed due to the changes introduced in the recent version of the third-party products, apps, or services. Contact support if the steps are not working for you.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\n<h1><span class=\"ez-toc-section\" id=\"The_Role_of_the_Virtual_Assistant\"><span style=\"font-weight: 400\">The Role of the Virtual Assistant<\/span><\/span><\/h1>\n<p><span style=\"font-weight: 400\">Apart from performing business functionality, our VA would also act as a proxy between the user and agent.<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><strong>Bot\/VA<\/strong><span style=\"font-weight: 400\">: The Virtual Assistant that the Users interact with.<\/span><\/li>\n<li style=\"font-weight: 400\"><strong>Users<\/strong><span style=\"font-weight: 400\">: Users are the customers who would be using this VA.<\/span><\/li>\n<li style=\"font-weight: 400\"><strong>Agent<\/strong><span style=\"font-weight: 400\">: Agents are humans who would converse with the users. Agents will also need a conversation window. For this we will use LivePerson \/ LiveChat software.<\/span><\/li>\n<\/ul>\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\n<h1><span class=\"ez-toc-section\" id=\"Prerequisites\"><span style=\"font-weight: 400\">Prerequisites<\/span><\/span><\/h1>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">A fully functional VA. See an example Travel Planning Assistant <a href=\"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/how-tos\/travel-planing-assistant\/create-a-travel-virtual-assistant\/\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Download BotKit SDK from <\/span><a href=\"https:\/\/github.com\/Koredotcom\/BotKit\"><span style=\"font-weight: 400\">Kore\u2019s github<\/span><\/a>.<\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Download and Install the Node.js (version 10 or above). The BotKit SDK requires node.js to run on the same server where the SDK is installed.<\/span>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Go to <\/span><code><span style=\"font-weight: 400\">https:\/\/nodejs.org\/en\/download\/<\/span><\/code><span style=\"font-weight: 400\"> and select your OS as a .pkg file type for Mac and .msi file type for Windows.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">In a Terminal window, run the <\/span><code><span style=\"font-weight: 400\">node -v<\/span><\/code><span style=\"font-weight: 400\"> command to verify installation and version, for example, v6.10.2.<\/span>.<\/li>\n<\/ol>\n<\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">A test callback server application. We will be using NGROK from <\/span><a href=\"https:\/\/dl.equinox.io\/ngrok\/ngrok\/stable\"><span style=\"font-weight: 400\">https:\/\/dl.equinox.io\/ngrok\/ngrok\/stable<\/span><\/a><span style=\"font-weight: 400\"> to simulate the callback server application. Following are the steps to install NGROK:<\/span>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Open <\/span><a href=\"https:\/\/dl.equinox.io\/ngrok\/ngrok\/stable\"><span style=\"font-weight: 400\">https:\/\/dl.equinox.io\/ngrok\/ngrok\/stable<\/span><\/a><span style=\"font-weight: 400\">.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Download and install the ngrok file for your operating system.<\/span>\n<ol>\n<li style=\"font-weight: 400\"><strong>On Windows:<\/strong>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Download the zip file for your Windows machine 32-bit or 64-bit<\/span>.<\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Unzip and run the <\/span><code><span style=\"font-weight: 400\">ngrok.exe<\/span><\/code><span style=\"font-weight: 400\"> file to install ngrok.<\/span><\/li>\n<\/ol>\n<\/li>\n<li style=\"font-weight: 400\"><strong>On MacOS:<\/strong>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Press <\/span><code><em><span style=\"font-weight: 400\">Command+Space<\/span><\/em><\/code><span style=\"font-weight: 400\"> and type <\/span><strong>Terminal<\/strong><span style=\"font-weight: 400\"> and press <\/span><strong>enter\/return<\/strong><span style=\"font-weight: 400\"> key.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Run in Terminal app:<\/span><span style=\"font-weight: 400\"><br \/>\n<\/span><code><span style=\"font-weight: 400\">ruby -e \"$(curl -fsSL https:\/\/raw.githubusercontent.com\/Homebrew\/install\/master\/install)\" &lt; \/dev\/null 2&gt; \/dev\/null<\/span><\/code><span style=\"font-weight: 400\"> and press <\/span><strong>enter\/return<\/strong><span style=\"font-weight: 400\"> key.<\/span><span style=\"font-weight: 400\"><br \/>\n<\/span><span style=\"font-weight: 400\">If the screen prompts you to enter a password, please enter your Mac\u2019s user password to continue. When you type the password, it won\u2019t be displayed on the screen, but the system will accept it. So just type your password and press the <strong>ENTER\/RETURN<\/strong> key. Then wait for the command to finish.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Run <\/span><span style=\"font-weight: 400\"><code>brew cask install ngrok<\/code>.<br \/>\n<\/span><\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">A live agent software. We will be using <a href=\"https:\/\/www.livechatinc.com\/\">LiveChatInc.com<\/a>. You can use your own LiveChat subscription or set up a free 30-day trial account at LiveChatInc.com by entering your business email in the <strong>Start using LiveChat!. <\/strong>Sign up and create an account.<br \/>\n<\/span><\/li>\n<\/ol>\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\n<h1><span class=\"ez-toc-section\" id=\"Design_and_Configuration\"><span style=\"font-weight: 400\">Design and Configuration<\/span><\/span><\/h1>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Open the Kore.ai XO Platform \u2013 <\/span><a href=\"https:\/\/bots.kore.ai\/botbuilder\"><span style=\"font-weight: 400\">https:\/\/bots.kore.ai\/botbuilder<\/span><\/a><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Select the VA for which Agent Transfer needs to be configured.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Open or create a dialog task (<\/span><em><span style=\"font-weight: 400\">Support Call Back)<\/span><\/em><span style=\"font-weight: 400\"> and add an <\/span><strong>Agent transfer<\/strong><span style=\"font-weight: 400\"> node.<br \/>\n<a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221004124334\/agent-transfer-node.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-47791\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221004124334\/agent-transfer-node.png\" alt=\"\" width=\"577\" height=\"446\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221004124334\/agent-transfer-node.png 912w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221004124334\/agent-transfer-node-300x232.png 300w\" sizes=\"auto, (max-width: 577px) 100vw, 577px\" \/><\/a><\/span><span style=\"font-weight: 400\"><br \/>\n<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Enter a <\/span><em><span style=\"font-weight: 400\">Name (LiveAgent)<\/span><\/em><span style=\"font-weight: 400\"> and <\/span><em><span style=\"font-weight: 400\">Description<\/span><\/em><span style=\"font-weight: 400\"> and <\/span><strong>Save<\/strong><span style=\"font-weight: 400\">.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">You will see a message \u2018<\/span><em><span style=\"font-weight: 400\">SDK is not currently configured\/Subscribed. Please go to API Extensions to configure the SDK.<\/span><\/em><span style=\"font-weight: 400\">\u2019. For now ignore this message as we will be showing how to configure SDK, later in this article.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">From the XO Platform screen go to <\/span><strong>Build &gt; Integrations &gt; Agent Transfer<\/strong>.<\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">In the <\/span><strong>App Name<\/strong><span style=\"font-weight: 400\"> section, select an existing app from the list or use the Create App option to create a new app.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Make a note of the <\/span><strong>Bot ID<\/strong><span style=\"font-weight: 400\">, <\/span><strong>Client ID<\/strong><span style=\"font-weight: 400\"> and <\/span><strong>Client Secret<\/strong><span style=\"font-weight: 400\"> keys.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Enter the Callback URL of your application, to be invoked by BotKIt SDK events. Since we are using NGROK, we will show how to obtain the callback URL:<\/span>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">In a <\/span><strong>Terminal<\/strong><span style=\"font-weight: 400\"> Window, start <\/span><em><span style=\"font-weight: 400\">ngrok<\/span><\/em><span style=\"font-weight: 400\"> to monitor port 8003 using the following command: <\/span><code><span style=\"font-weight: 400\">ngrok http 8003<\/span><\/code><span style=\"font-weight: 400\">.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Copy ngrok forwarding URL. It will be in the format \u2013 <\/span><code><span style=\"font-weight: 400\"><a href=\"http:\/\/XXXXXXaa.ngrok.io\">http:\/\/XXXXXXaa.ngrok.io<br \/>\n<\/a><\/span><\/code><code><a href=\"http:\/\/XXXXXXaa.ngrok.io\"><\/a><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221004124343\/AT-callbackurl-ngrok-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-47797\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221004124343\/AT-callbackurl-ngrok-1.png\" alt=\"\" width=\"640\" height=\"165\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221004124343\/AT-callbackurl-ngrok-1.png 642w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221004124343\/AT-callbackurl-ngrok-1-300x78.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a>.<\/code><span style=\"font-weight: 400\"><br \/>\n<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Use this forwarding URL as the call back URL and save.<\/span><span style=\"font-weight: 400\"><br \/>\n<\/span><\/p>\n<table style=\"width: 100%;border-collapse: collapse;background-color: #fffbea\">\n<tbody>\n<tr>\n<td style=\"width: 100%\"><strong>Note<\/strong><span style=\"font-weight: 400\">: The forwarding URL changes whenever the ngrok is restarted. Make sure you make the changes to the callback URL every time ngrok is restarted.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong><br \/>\n<\/strong><\/li>\n<\/ol>\n<\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">The agent transfer is configured at the dialog level. You can open the dialog task, and open the agent transfer node to see that the configuration is saved. You can select the Events required.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Install any live agent software eg Livechat, Liveperson, Concentrix, Vayusphere etc depending on your enterprise requirement and license availability. Since we are using LiveChat, we will should you how to obtain the license details needed for Agent Transfer:<\/span>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Sign in to your LiveChat account.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Go to <\/span><strong>Settings<\/strong><span style=\"font-weight: 400\"> from the left navigation and select <\/span><strong>Chat Link<\/strong><span style=\"font-weight: 400\">.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Copy the URL and note the <\/span><strong>license code<\/strong><span style=\"font-weight: 400\">. If the URL is <\/span><code><span style=\"font-weight: 400\">https:\/\/lc.chat\/now\/104xx297\/<\/span><\/code><span style=\"font-weight: 400\"> and then the license code is <\/span><span style=\"font-weight: 400\">104xx297<\/span>.<\/li>\n<\/ol>\n<\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Open the downloaded <\/span><strong>BotKit SDK folder<\/strong><span style=\"font-weight: 400\"> and do the following:<\/span>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Edit <\/span><span style=\"font-weight: 400\"><code>livechatapi.js<\/code>.<\/span>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Give the respective botId and botName of your VA, which you have copied earlier.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">This JS file contains 3 API\u2019s of Kore \u2013 Initialization, Send Message, Get Message. If required, any new API\u2019s written for human agent transfer should be put in here.<\/span><span style=\"font-weight: 400\"><br \/>\n<\/span><span style=\"font-weight: 400\">Example: If closing connection is required, then close connection api written needs to go into livechatapi.js<br \/>\n<a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221004124358\/AT-livechatapi-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-47806\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221004124358\/AT-livechatapi-2-1024x328.png\" alt=\"\" width=\"640\" height=\"205\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221004124358\/AT-livechatapi-2-1024x328.png 1024w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221004124358\/AT-livechatapi-2-300x96.png 300w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221004124358\/AT-livechatapi-2.png 1072w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/>.<\/a><br \/>\n<\/span><\/li>\n<\/ol>\n<\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Edit <\/span><code><span style=\"font-weight: 400\">config.json<\/span>.<\/code>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Client ID, Client Secret key, respective server ports running and liveagent license of the third-party server goes here.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Client Id, Client Secret can be copied from Events and Extensions \u2013 Agent Transfer.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">ngrok forwarding url can be copied from ngrok running instance. It is the call back url. This should be the URL entry.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Liveagentlicense is the code given in the chatlink of livechat.<br \/>\n<a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221004124347\/AT-configjson-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-47800\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221004124347\/AT-configjson-2.png\" alt=\"\" width=\"640\" height=\"383\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221004124347\/AT-configjson-2.png 841w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221004124347\/AT-configjson-2-300x179.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><br \/>\n<\/span><\/li>\n<\/ol>\n<\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Edit <\/span><code><span style=\"font-weight: 400\">LiveChat.js<\/span><\/code>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Give the respective botId and botName, which you have copied earlier and save.<br \/>\n<a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221004124353\/AT-livechat-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-47803\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221004124353\/AT-livechat-2-1024x529.png\" alt=\"\" width=\"640\" height=\"331\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221004124353\/AT-livechat-2-1024x529.png 1024w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221004124353\/AT-livechat-2-300x155.png 300w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221004124353\/AT-livechat-2.png 1075w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/span><span style=\"font-weight: 400\"><br \/>\n<\/span><\/li>\n<\/ol>\n<\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Edit <code>app.js<\/code><\/span>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Add the following line <\/span><code><span style=\"font-weight: 400\">sdk.registerBot(require('.\/LiveChat.js'))<\/span><\/code>.<\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Delete any existing sdk.registerBot statements, if not needed.<br \/>\n<a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221004124339\/AT-appjs-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-47794\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221004124339\/AT-appjs-1.png\" alt=\"\" width=\"432\" height=\"234\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221004124339\/AT-appjs-1.png 375w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221004124339\/AT-appjs-1-300x162.png 300w\" sizes=\"auto, (max-width: 432px) 100vw, 432px\" \/><\/a><br \/>\n<\/span>.<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\n<h1><span class=\"ez-toc-section\" id=\"Execution\"><span style=\"font-weight: 400\">Execution<\/span><\/span><\/h1>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Open a terminal window and run the BotKit SDK by entering the command:<\/span><span style=\"font-weight: 400\"><br \/>\n<\/span><code><span style=\"font-weight: 400\">node app.js<\/span><\/code><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Please make sure to install all the missing modules for running the server successfully without any errors as shown below.<\/span><span style=\"font-weight: 400\"><br \/>\n<\/span><span style=\"font-weight: 400\">Example, if error \u201c<\/span><em><span style=\"font-weight: 400\">method url-template, node-schedule are missing\u201d<\/span><\/em><span style=\"font-weight: 400\"> is shown, then install the above modules using command<\/span>.<span style=\"font-weight: 400\"><br \/>\n<\/span><code><span style=\"font-weight: 400\">npm install &lt;module-name&gt;<\/span><\/code><span style=\"font-weight: 400\"> for windows, <\/span><span style=\"font-weight: 400\">sudo <code>npm install &lt;module-name&gt;<\/code><\/span><span style=\"font-weight: 400\"> for mac<\/span>.<\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">ngrok and node.js server will be running in different terminals.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">When a user initiates the conversation from the VA, it transfers the call to an agent and sends a message to the user<\/span>.<\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">An agent receives a notification about this on the livechat<\/span>.<\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Now the connection between the agent and the user has been established and the conversation continues.<\/span>.<\/li>\n<\/ol>\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div><span style=\"font-weight: 400\"><br \/>\n<\/span><\/p>\n<h1><span class=\"ez-toc-section\" id=\"Events\"><span style=\"font-weight: 400\">Events<\/span><\/span><\/h1>\n<table style=\"width: 100%;border-collapse: collapse;background-color: #fffbea\">\n<tbody>\n<tr>\n<td style=\"width: 100%\"><strong>Note<span style=\"font-weight: 400\">: The events and methods required for sending messages from the User or the VA and transferring to Agent are outlined in LiveChat.JS<\/span><\/strong>.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<ol>\n<li style=\"font-weight: 400\"><em><span style=\"font-weight: 400\">on_user_message<\/span><\/em><span style=\"font-weight: 400\"> event is triggered when a user sends a message and this message is sent to the VA using sendBotMessage method.<\/span><\/li>\n<li style=\"font-weight: 400\"><em><span style=\"font-weight: 400\">on_bot_message<\/span><\/em><span style=\"font-weight: 400\"> is triggered when the VA sends a message and this message is sent to the user using SendUserMessage method.<\/span><\/li>\n<li style=\"font-weight: 400\"><em><span style=\"font-weight: 400\">on_agent_transfer<\/span><\/em><span style=\"font-weight: 400\"> event is triggered when the service agentTransfer node is triggered in the VA. And this event connects to the agent using connectToAgent method, which internally calls initconversationAPI<\/span>.<\/li>\n<li style=\"font-weight: 400\"><em><span style=\"font-weight: 400\">gethistory<\/span><\/em><span style=\"font-weight: 400\"> method, gives the conversation history of the user with the VA to the transferred agent<\/span><\/li>\n<li style=\"font-weight: 400\"><em><span style=\"font-weight: 400\">scheduleJob<\/span><\/em><span style=\"font-weight: 400\"> is run for every 5 secs and it polls for the pending messages from the Agent, which internally calls getPendingMessages<\/span>.<\/li>\n<li style=\"font-weight: 400\"><em><span style=\"font-weight: 400\">getPendingMessages<\/span><\/em><span style=\"font-weight: 400\"> gets all the pending messages from Agent and delivers it to the User<\/span>.<\/li>\n<li style=\"font-weight: 400\"><em><span style=\"font-weight: 400\">chat_closed<\/span><\/em><span style=\"font-weight: 400\"> gets triggered when the agent closes the conversation with the user.<\/span><\/li>\n<\/ol>\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>One of the frequently asked questions is how to transfer a conversation to a human agent from a Virtual Assistant. This is especially necessary if your VA is in the space of customer service. Virtual Assistants are not meant to completely replace humans. Many times the assistant will fail to answer satisfactorily or the user&#8230;<\/p>\n","protected":false},"author":27,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[197],"tags":[],"class_list":["post-48040","post","type-post","status-publish","format-standard","hentry","category-travel-planing-assistant"],"_links":{"self":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/48040","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/users\/27"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/comments?post=48040"}],"version-history":[{"count":7,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/48040\/revisions"}],"predecessor-version":[{"id":53566,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/48040\/revisions\/53566"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/media?parent=48040"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/categories?post=48040"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/tags?post=48040"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}