vania-janet/multiturn-rag-retrieval-data huggingface dataset:
Currently, the web chat integration is the only supported target of a channel transfer.



 Integration channel support 



 Phone SMS Slack Facebook WhatsApp 

 ![Yes](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/checkmark-icon.svg) ![Yes](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/checkmark-icon.svg) ![Yes](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/checkmark-icon.svg) ![Yes](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/checkmark-icon.svg) ![Yes](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/checkmark-icon.svg) 





* The indicated channel integrations support initiating a channel transfer (currently, the web chat integration is the only supported transfer target).
* Initiating a channel transfer from the phone integration requires that the SMS integration also be configured.







 Fields 



 Name Type Description Required? 

 response_type string channel_transfer Y 
 message_to_user string A message to display to the user before the link for initiating the transfer. Y 
 transfer_info object Information used by an integration to transfer the conversation to a different channel. Y
* You can [prevent unauthorized access](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-web-chat-securityweb-chat-security-encrypt) to sensitive customer information by encrypting it and including it as part of the JWT user payload.

The user payload is a part of the JWT you can use to send information you want your assistant to have access to, but that you do not want customers to see. This information is stored only in private variables, which cannot be seen by customers and are never included in logs.

For more information about using the user payload to protect sensitive information, see [Encrypting sensitive data](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-web-chat-security-encrypt).



![development icon](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/development-icon.png)Tutorial: For a developer tutorial that shows an example of using web chat security to authenticate users and protect sensitive data, see [Tutorial: Authenticating a user in the middle of a session](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-web-chat-develop-security).
[Learn more](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-system-entities). 
 Try it out A chat window that you use to test as you build. For example, from the dialog skill's Try it out pane, you can mimic the behavior of a customer and enter a query to see how the assistant responds. You can test only the current skill; you cannot test your assistant and all attached skills from end to end. [Learn more](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-dialog-tasks). 
 Web chat An integration that you can use to embed your assistant in your company website. [Learn more](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-deploy-web-chat). 
 Webhook A mechanism for calling out to an external program as part of the dialog. For example, if a customer asks the assistant to translate a string from English to French, the dialog can call an external language translation service to translate the phrase and return the translation to the customer in the course of the conversation. [Learn more](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-dialog-webhooks). 



* I don’t see the Analytics page

You can only view the Analytics page if the system administrator enabled the feature in your deployment. A prerequisite service that is required by the feature is only available on OpenShift Red Hat 4.5; it is not available on 3.11.
* Where can I find an example for creating my first assistant?

Follow the steps in the [Getting started with Watson Assistant](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-getting-started) tutorial for a product introduction and to get help creating your first assistant.
* Can I export the user conversations from the Analytics page?

You cannot directly export conversations from the User conversation page. You can, however, use the /logs API to list events from the transcripts of conversations that occurred between your users and your assistant.
In our example, we are using a CSS class called HideWebChat to do this (see the [full example](https://github.com/watson-developer-cloud/assistant-toolkit/blob/master/integrations/webchat/examples/custom-element/client/javascript-animation/index.html) for the definition of this class):

function onLoad(instance) {
instance.render();
instance.on({ type: 'window:close', handler: closeHandler });
instance.on({ type: 'window:open', handler: openHandler });
instance.elements.getMainWindow().addClassName('HideWebChat');
}
5. Create handlers to hide and show the main web chat window in response to the window:open and window:close. This example simply shows and hides the element; the [full example](https://github.com/watson-developer-cloud/assistant-toolkit/blob/master/integrations/webchat/examples/custom-element/client/javascript-animation/index.html) shows how you can add animation effects.

function closeHandler(event, instance) {
instance.elements.getMainWindow().addClassName('HideWebChat');
}

function openHandler(event, instance) {
instance.elements.getMainWindow().removeClassName('HideWebChat');
}



For complete working code, see the [Custom elements for Watson Assistant web chat](https://github.com/watson-developer-cloud/assistant-toolkit/tree/master/integrations/webchat/examples/custom-element) example.
* Chatbot conversations fed back into HR policies, allowing the benefits site to reflect which benefits were most and least popular, including targeted improvements to poorly performing initiatives.







 Step 3: Chatbot and personalization 

Watson Assistant provides tools to quickly scaffold a chatbot that can provide the correct benefits information to users.





 Step 4: Deliver continuously across the globe 



* IBM Cloud® Continuous Delivery helps Developers to quickly provision an integrated toolchain, by using customizable, shareable templates with tools from IBM, third parties, and open source. Automate builds and tests, controlling quality with analytics.
* After Developers build and test the apps in their Development and Test clusters, they use the IBM CI/CD toolchains to deploy apps into Production clusters across the globe.
* IBM Cloud Kubernetes Service provides easy rollout and roll-back of apps. Tailored apps are deployed to meet regional requirements through the intelligent routing and load balancing of Istio.
* Built-in HA tools in IBM Cloud Kubernetes Service balance the workload within each geographic region, including self-healing and load balancing.









 Results 



* With tools like the chatbot, the HR team proved to their workforce that innovation was part of the corporate culture, not just buzz words.
* Authenticity with personalization in the site addressed the changing expectations of the airline’s workforce today.
* Last-minute updates to the HR site, including ones that driven by the employees chatbot conversations, went live quickly because Developers were pushing changes at least 10 times daily.
* With infrastructure management taken care of by IBM, the Development team was freed up to deliver the site in only 3 weeks.
For more information, see [Managing user identity information](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-web-chat-develop-userid). 
 Slack The Slack member ID (for example, U2147483697). 
 Facebook The Facebook sender ID (for example, 4310101122439797). 
 Whatsapp The customer's phone number. 
 Phone The customer's phone number. 
 SMS with Twilio The customer's phone number. 









 chat 

Included only if the web chat integration is in use.



 Properties 



Properties of the chat object

 Name Type Description 

 browser_info.browser_name String The browser name, such as chrome, edge, or firefox. 
 browser_info.browser_version String The browser version, such as 109.0.0. 
 browser_info.browser_OS String The operating system of the customer's computer, such as Mac OS. 
 browser_info.language String The default locale code of the browser, such as en-US. 
 browser_info.page_url String The URL of the web page where the web chat is embedded, not including any query parameters or hashes. 
 browser_info.screen_resolution String The height and width of the browser window, such as width: 1440, height: 900. 
 browser_info.user_agent String The content of the HTTP User-Agent request header. 
 browser_info.client_ip_address String The IP address of the customer's computer. 
 browser_info.ip_address_list Array Ann array IP addresses specified by HTTP X-Forwarded-For request headers. 







 Example JSON 

"chat": {
"browser_info": {
"browser_name": "chrome",
"browser_version": "109.0.0",
"browser_OS": "Mac OS",
"language": "en-US",
It is not triggered from here because nodes with the welcome special condition are skipped in dialog flows that are started by users. Slack waits for the user to initiate the conversation. For more information about how to set context variable values consistently at the start of a conversation, see [Starting the dialog](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-start).

You can upload media files or even documents to the chat. Files shared in the chat can be intercepted and processed by a configured premessage webhook. For more details, see [Processing input attachments](https://cloud.ibm.com/docs/assistant?topic=assistant-api-input-attachments).

The dialog flow for the current session is restarted after 60 minutes of inactivity (5 minutes for Lite and Standard plans). This means that if a user stops interacting with the assistant, after 60 (or 5) minutes, any context variable values that were set during the previous conversation are set to null or back to their default values.
* From the web chat integration page in Watson Assistant, copy the code snippet from the Visualforce page markup field.
* Switch to your Salesforce web page. Search for Visualforce Pages. Create a page. Add a label and name to the page. Select the Available for Lightning Experience, Lightning Communities, and the mobile app checkbox. Paste the code snippet that you copied in the previous step into the page markup field.



7. Add the Visualforce page that you created to the Salesforce chat app.

To ensure the Salesforce agents can see history of the chat between the customer and your assistant, you must add the page that you created earlier into the console that they use to keep track of their work. See [Create and Configure Lightning Experience Record Pages](https://help.salesforce.com/articleView?id=lightning_app_builder_customize_lex_pages.htm&type=5).



* From the Salesforce App Launcher, open the chat app that you created for your agents to talk to customers.
* Open the Chat Transcripts object, and then select a transcript page.
* Click the Setup icon, and then select Edit Page.
* Drag the Visualforce component and drop it into the Chat Transcript Record page layout where you want the chat window to be displayed.
* In the component editor, select the Visualforce page that you created earlier, make any adjustments to the component height that you want, and then click Save.

If you do make changes, make sure the height of the Visualforce page is 20 px smaller than the height of the component that you add it to. By default, the height of the component is 300 px and the height of the Visualforce page is 280 px. (The height of the Visualforce page is specified in the height attribute of the iframe HTML element in the code snippet that you copy and paste.)
* Click Activation, and then click the APP, RECORD TYPE, AND PROFILE tab.
* Select the apps to which you want to apply the page layout, and then click Next.
* Select the appropriate record type, such as Main, and then click Next.
setTimeout(function(){const t=document.createElement('script');t.src="https://web-chat.global.assistant.watson.appdomain.cloud/versions/" + (window.watsonAssistantChatOptions.clientVersion || 'latest') + "/WatsonAssistantChatEntry.js";document.head.appendChild(t);});
</script>
</body>
</html>
Show more

In your app, make sure you include logic to hide your web chat launching mechanism when the device is offline. If the device goes offline in the middle of a conversation, appropriate error messages and retries occur.





 Using a JavaScript bridge 

In some situations, your mobile application might need to communicate with the Watson Assistant web chat. For example, you might need to set initial context data (such as a user ID or account information) or use the web chat security feature. To do this, you can use a JavaScript bridge.

A JavaScript bridge is a common pattern that can be used on all mobile platforms. Implementation details differ from one mobile application framework to another; you can find specific examples on how to implement a JavaScript bridge for the framework you are using. However, the core concept of sending events back and forth between the mobile app and the web chat apply to all frameworks.

With a JavaScript bridge, events are sent between the mobile app and the WebView, and event listeners exist on both sides of the bridge to handle those events. Each event carries a message payload; because this payload is text-only, you must stringify and parse JSON objects to pass data back and forth.

If your mobile application needs to call a web chat instance method, you must call the method by sending an event from the app to the WebView using the JavaScript bridge. Similarly, if you need to run code in your mobile application in response to behavior in the web chat, you can send an event through the JavaScript bridge from the web chat to your mobile application.

You can make use of the user_defined response type and the customResponse event to drive behavior on your mobile application.
In your onLoad event handler, use the [once()](https://web-chat.global.assistant.watson.cloud.ibm.com/docs.html?to=api-instance-methodsonce) instance method to subscribe to the pre:send event, registering the preSendHandler() function as the callback. (We can use once() instead of on() because this handler needs to be called only for the first message in the session.)

instance.once({ type: 'pre:send', handler: preSendHandler});



For complete working code, see the [Select greeting action for Watson Assistant web chat](https://github.com/watson-developer-cloud/assistant-toolkit/tree/master/integrations/webchat/examples/select-greeting-action) example.
{: note}

1. conversation_id (v1 only): A property defined in the v1 API that is stored in the context object of a /message API call. This property can be used to identify multiple /message API calls that are associated with a single conversational exchange with one user. However, the same ID is only used if you explicitly retain the ID and pass it back with each request that is made as part of the same conversation. Otherwise, a new ID is generated for each new /message API call.
Show more

Design any custom applications to capture a unique user_id or session_id and pass the information to Watson Assistant. Choose a non-human-identifiable ID that doesn't change throughout the customer lifecycle. For example, don't use a person's email address as the user ID. In fact, the user_id syntax must meet the requirements for header fields as defined in [RFC 7230](https://tools.ietf.org/html/rfc7230section-3.2).

The built-in integrations derive the user ID in the following ways:



* For web chat, you can set the value of the user_id property. For more information, see [Adding user identity information](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-deploy-web-chatdeploy-web-chat-userid).





 Handling anonymous users 

If your custom application or assistant interacts with users who are anonymous, you can generate a randomized universally unique ID to represent each anonymous user. For more information about UUIDs, see [RFC 4122](https://tools.ietf.org/html/rfc4122.html).



* For web chat, if you do not pass an identifier for the user when the session begins, the web chat creates one for you. It creates a first-party cookie with a generated anonymous ID. The cookie remains active for 45 days. If the same user returns to your site later in the month and chats with your assistant again, the web chat integration recognizes the user.









 Service API versioning
If you do enable security, you set the user ID in the JSON Web Token instead. For more information, see [Authenticating users](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-deploy-web-chatdeploy-web-chat-security-authenticate).

Choose a non-human-identifiable ID. For example, do not use a person's email address as the user_id.

User information is used in the following ways:



* User-based service plans use the user_id associated with user input for billing purposes.





* The ability to delete any data created by someone who requests to be forgotten requires that a customer_id be associated with the user input. When a user_id is defined, the product can reuse it to pass a customer_id parameter.

Because the user_id value that you submit is included in the customer_id value that is added to the X-Watson-Metadata header in each message request, the user_id syntax must meet the requirements for header fields as defined in [RFC 7230](https://tools.ietf.org/html/rfc7230section-3.2).



To support these user-based capabilities, add the [updateUserID() method](https://web-chat.global.assistant.watson.cloud.ibm.com/docs.html?to=api-instance-methodsupdateuserid) in the code snippet before you paste it into your web page.

In the following example, the user ID L12345 is added to the script.

<script>
window.watsonAssistantChatOptions = {
integrationID: 'YOUR_INTEGRATION_ID',
region: 'YOUR_REGION',
serviceInstanceID: 'YOUR_SERVICE_INSTANCE',
cloudPrivateHostURL: 'YOUR_HOST_URL',
onLoad: function(instance) {
instance.updateUserID('L12345');
instance.render();
}
};
setTimeout(function(){
const t=document.createElement('script');
Test messages that you send from the Preview button are charged. For the preview, a random user_id is generated and stored in a cookie. The multiple interactions that a single tester has with the assistant embedded in the preview are recognized as coming from a single user and are charged accordingly. If you are doing your own test, running a scripted regression test for example, use a single user_id for all of the calls within your regression test. Other uses are flagged as abuse.





 Handling anonymous users 

If your custom application or assistant interacts with users who are anonymous, you can generate a randomized universally unique ID to represent each anonymous user. For more information about UUIDs, see [RFC 4122](https://tools.ietf.org/html/rfc4122.html).



* For web chat, if you do not pass an identifier for the user when the session begins, the web chat creates one for you. It creates a first-party cookie with a generated anonymous ID. The cookie remains active for 45 days. If the same user returns to your site later in the month and chats with your assistant again, the web chat integration recognizes the user. And you are charged only once when the same anonymous user interacts with your assistant multiple times in a single month.



If an anonymous user logs in and later is identified as being the same person who submitted a request with a known ID, you are charged twice. Each message with a unique user ID is charged as an independent active user. To avoid this situation, you can prompt users to log in before you initiate a chat or you can use the anonymous user ID to represent the user consistently.





 Data centers 

IBM Cloud has a network of global data centers that provide performance benefits to its cloud services. See [IBM Cloud global data centers](https://www.ibm.com/cloud/data-centers/) for more details.

You can create Watson Assistant service instances that are hosted in the following data center locations:



Data center locations

 Location Location code API location 

 Dallas us-south N/A 
 Frankfurt eu-de fra 
 Seoul kr-seo seo 
 Sydney au-syd syd 
 Tokyo jp-tok tok 
 London eu-gb lon
The WebSocket section also discusses the maximum frame or message size of 4 MB enforced by the WebSocket interface.

HTTP and WebSocket interfaces can now return warnings
: The JSON response for a recognition request can now include an array of warning messages for invalid query parameters or JSON fields that are included with a request. Each element of the array is a string that describes the nature of the warning followed by an array of invalid argument strings. For example, "warnings": [ "Unknown arguments: u'{invalid_arg_1}', u'{invalid_arg_2}']." ]. For more information, see the [API & SDK reference](https://cloud.ibm.com/apidocs/speech-to-text).

Beta Apple iOS SDK is deprecated
: The beta Watson Speech Software Development Kit (SDK) for the Apple® iOS operating system is deprecated. Use the Watson SDK for the Apple® iOS operating system instead. The new SDK is available from the [ios-sdk repository](https://github.com/watson-developer-cloud/ios-sdk) in the watson-developer-cloud namespace on GitHub.

WebSocket interface can produce delayed results
: The WebSocket interface can take minutes to produce final results for a recognition request for an especially long audio file. For the WebSocket interface, the underlying TCP connection remains idle while the service prepares the response. Therefore, the connection can close due to a timeout. To avoid the timeout with the WebSocket interface, request interim results ("interim_results": "true") in the JSON for the start message to initiate the request. You can discard the interim results if you do not need them. This issue will be resolved in a future update.





 19 January 2016 

New profanity filtering feature
: The service was updated to include a new profanity filtering feature on January 19, 2016. By default, the service censors profanity from its transcription results for US English audio.
This private context variable will be available for use by the dialog, but not by anything else.



1. From the web chat configuration page, copy the public key from the IBM provided public key field.
2. From your website, write a function that signs a JSON Web Token.

For example, the following NodeJS code snippet shows a function that accepts a userID and payload content and sends it to the web chat. If a payload is provided, its content is encrypted and signed with the IBM public key.

// Sample NodeJS code on your server.
const jwt = require('jsonwebtoken');
const RSA = require('node-rsa');

const rsaKey = new RSA(process.env.PUBLIC_IBM_RSA_KEY);

/
* Returns a signed JWT. Optionally, adds an encrypted user_payload in stringified JSON.
/
function mockLogin(userID, userPayload) {
const payload = {
sub: userID, // Required
iss: 'www.ibm.com' // Required
};
if (userPayload) {
// If there is a user payload, it is encrypted in base64 format using the IBM public key.
payload.user_payload = rsaKey.encrypt(userPayload, 'base64');
}
const token = jwt.sign(payload, process.env.YOUR_PRIVATE_RSA_KEY, { algorithm: 'RS256', expiresIn: '10000ms' });
return token;
}

Show more
3. The encrypted user payload is decrypted and then saved to the context.integrations.chat.private.user_payload object.