IBM Watson Integration
Overview
Watson chatbot is a conversational AI platform that helps you answer customer’s queries with fast, and accurate answers. Kommunicate provides a codeless integration with Amazon Lex. You can easily integrate a bot from the bot section in Kommunicate dashboard.
Integrate with Watson
Kommunicate requires the following information to query the chatbot on behalf of the user. This information is available from the IBM cloud console.
- API key : The API key is the token assigned to a device that has been granted a specific level of delegated access to the IBM Cloud organisation. Only after an API key and token are generated can a registered device interact with an application. To get the API key navigate to Resource List and select the assistant listed in AI/ Machine Learning.
- Service URL : Its purpose is to identify the base URL for your service instance, and the URL represents a Watson Assistant instance hosted in which region. The service URL can be obtained from the resource list in the same services option.
NOTE: Do not use the URL mentioned under Assistant Settings, the URL must be from the Manage section of the Assistant.
- Environment ID : The bot is given an Environment; for example, each Watson Assistant created in your IBM cloud account will have an Draft Environment ID and Live Environment ID.
Click on Launch Watson Assistant
.
Click on Assitant Settings
.
Under Assistant IDs and API details
, click on View Details
.
Copy the Environment Id and click on Close
.
After obtaining the above information, proceed with the following steps to integrate the bot with Kommunicate.
- Login to Kommunicate and go to bot section.
- Click the
Integrate Bot
in IBM Watson card. - Fill the required detail and click next.
- Give the bot a name. This name will be visible to all the users who interact with the bot.
- Enable/Disable the
autoHandoff
setting if you want your bot to assign the conversation to a human agent in your team when conversation is hung up by bot. - Select
Let this bot handle all new conversation
and all new Conversations started after the integration will be assigned to this bot, and the bot will begin responding to them.
Welcome message
Welcome node contains a greeting message that is displayed to the users when they first engage with the assistant. It is dialog node that is triggered by the welcome
condition. This node specifies that when a new conversation starts, the system should respond with the welcome message that you add to the response section of this first node.
In the edit view, you can change/replace the default text response.
Types of Rich Messages in IBM Watson
Rich messages that are supported in IBM Watson that can be used in Kommunicate chat:
How to add the supported rich messages in IBM Watson:
Log in to your IBM Waston assistant console and click on the Resouces List from the left side menu
Find the Services option and click on the Assistant listed inside the Services
Launch Waton Assistant & click on the Assistant that you've created
Now click on the "Dialog" of that Assistant. It will show list of Intents, Entities, Dialog, etc.
Click on "Dialog" & then click on the node.
Select the message type [Example: Image, Option]
Images
Select the Assistant responds as 'Image' and provide an image source (Note: source cannot be longer than 512 characters)
Quick Replies
Select the Assistant responds as 'Option'. Click 'Add Option+' and enter the quick reply options in the Enter label
and Enter Value
fields.
For all other Kommunicate rich messages, you have to put Kommunicate rich message JSON inside the IBM Watson JSON template format. Inside user_defined key
, put the Kommunicate JSON payload
{
"output": {
"generic": [
{
"user_defined":
--------
Kommunicate rich message JSON
--------
,
"response_type": "user_defined"
}
]
}
}
Some examples are mentioned below.
Link Button
{
"output": {
"generic": [
{
"user_defined": {
"message": "click on the buttons",
"metadata": {
"payload": [
{
"url": "https://www.amazon.com/s?k=men+dresses&ref=nb_sb_noss_2",
"name": "🤵Men Dresses",
"type": "link"
},
{
"name": "👸Women Dresses",
"url": "https://www.amazon.com/s?k=women+clothing&crid=85W5AF67F3FZ&sprefix=women+clo%2Caps%2C519&ref=nb_sb_ss_i_1_9",
"type": "link"
},
{
"url": "https://www.amazon.com/s?k=watches&ref=nb_sb_noss_2",
"name": "⌚Watches",
"type": "link"
},
{
"url": "https://www.amazon.com/s?k=accessories+for+women&crid=3T0OO2UGMCSOS&sprefix=access%2Caps%2C437&ref=nb_sb_ss_i_6_6",
"name": "👜Accessories",
"type": "link"
},
{
"url": "https://www.amazon.com/s?k=mobile&ref=nb_sb_noss_2",
"name": "📲Mobiles",
"type": "link"
},
{
"openLinkInNewTab": true,
"url": "https://www.amazon.com/s?k=personal+care&crid=XOU0P7MKU1O0&sprefix=personal+care%2Caps%2C646&ref=nb_sb_ss_i_1_13",
"name": "💄Personal Care",
"type": "link"
}
],
"templateId": "3",
"contentType": "300"
},
"platform": "kommunicate"
},
"response_type": "user_defined"
}
]
}
}
Card Carousel
{
"output": {
"generic": [
{
"user_defined": {
"message": "Shop 🛍️ our unique collections⭐",
"metadata": {
"templateId": "10",
"contentType": "300",
"payload": [
{
"buttons": [
{
"name": "Shop Now",
"action": {
"payload": {
"url": "https://www.amazon.com/s?k=men+fashion&crid=2AWHC23U7KS5A&sprefix=men+fas%2Caps%2C466&ref=nb_sb_ss_i_1_7"
},
"type": "link"
}
}
],
"title": "MEN'S FASHION",
"description": "Fashion is what you’re offered four times a year by designers. And style is what you choose.",
"titleExt": "4.5/5",
"header": {
"imgSrc": "https://images.unsplash.com/photo-1493146146946-e907f69cdf23?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=890&q=80"
}
},
{
"title": "WOMEN'S FASHION",
"header": {
"imgSrc": "https://images.unsplash.com/photo-1589960062943-bfb9f51756fa?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=750&q=80"
},
"buttons": [
{
"name": "Shop Now",
"action": {
"type": "link",
"payload": {
"url": "https://www.amazon.com/s?k=women+fashion+tops&crid=223ZVO20GFDP6&sprefix=women+fashio%2Caps%2C549&ref=nb_sb_ss_i_1_12"
}
}
}
],
"description": "Style is something each of us already has, all we need to do is find it.",
"titleExt": "4.8/5"
},
{
"titleExt": "4.8/5",
"description": "Looking for watches? We stock a huge range of designer watches for gents, women, kids from famous brands",
"buttons": [
{
"name": "Shop Now",
"action": {
"payload": {
"url": "https://www.amazon.com/s?k=watch&crid=FSYRY8G29WSC&sprefix=watch%2Caps%2C1077&ref=nb_sb_ss_i_5_5"
},
"type": "link"
}
}
],
"title": "WATCHES",
"header": {
"imgSrc": "https://images.unsplash.com/photo-1558505780-e7a9d70b4bab?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=873&q=80"
}
}
]
},
"platform": "kommunicate"
},
"response_type": "user_defined"
}
]
}
}
List Template
{
"output": {
"generic": [
{
"user_defined": {
"platform": "kommunicate",
"metadata": {
"payload": {
"headerText": "Best Headphones 🎧 under 2000",
"elements": [
{
"action": {
"type": "link",
"url": "https://www.amazon.in/Boat-Rockerz-400-Bluetooth-Headphones/dp/B01J82IYLW/ref=sr_1_1"
},
"description": "HD Clarity with Super Bass, Noise Cancelling, Playing time: Up to 8 hours",
"imgSrc": "https://i.pinimg.com/originals/a2/82/1e/a2821ef77269ac2186ee260395ec7474.jpg",
"title": "Boat Rockerz 400 On-Ear Bluetooth Headphones"
},
{
"imgSrc": "https://i.pinimg.com/originals/82/e3/db/82e3dbfdd51fec40b8bc5bdeb0c7f4bf.jpg",
"description": "Earphones with a user-friendly design and a life-like rhythmic reaction can be a great accessory for music enthusiasts.",
"action": {
"type": "link",
"url": "https://www.amazon.in/Sony-MDR-ZX110A-Stereo-Headphones-without/dp/B00KGZZ824/ref=sr_1_3"
},
"title": "Sony MDR-ZX110A On-Ear Stereo Headphones"
},
{
"action": {
"type": "link",
"url": "https://www.amazon.in/Heads-900-Wired-Headphones-White/dp/B078W65FJ7/ref=sr_1_5"
},
"title": "boAt Bass Heads 900 Wired Headphones with Mic",
"imgSrc": "https://images-eu.ssl-images-amazon.com/images/I/414uBpZsGcL.jpg",
"description": "The boAt Bass Heads 900 wired headphones come with an amalgamation of style with performance."
}
]
},
"templateId": "7",
"contentType": "300"
},
"message": "Shop now & enjoy 🎧"
},
"response_type": "user_defined"
}
]
}
}
Human Handoff (Assign conversation to a particular agent)
If you wish to assign a conversation to specific agent upon intent matching overriding the conversation rules in dashboard. Metadata needs to be passed, please follow the below steps;
Click on Dialog, Add node, give a name to the node (Sales Team in the example below), on the 'If assistant recognizes' option, select the intent, then click on three vertical dots on the right side of 'Assistant responds'.
Click Open JSON Editor and add this payload and save it.
{
"output": {
"generic": [
{
"user_defined": {
"message": "Agent123 will get back to you",
"metadata": {
"KM_ASSIGN_TO": "Agent123%@%gmail.com"
},
"platform": "kommunicate"
},
"response_type": "user_defined"
},
{
"values": [],
"response_type": "text",
"selection_policy": "sequential"
}
]
},
"context": {}
}
Note: The character “@“ should be preceded and suceeded by '%' in the agent email field.
For Team assignment, you can use KM_ASSIGN_TEAM followed by Team ID.
NOTE: The team assignment will not work in bot test link. You may need to test this in your real Website/App.