If you’ve built your own bot with a third-party bot provider and want to manage its deployment using Comm100, you can integrate with Comm100 using Webhooks. Once set up, your integrated bot can be deployed over Live chat, Social (such as Facebook and Twitter), and SMS channels.
Step by Step Instructions
To integrate your third-party chatbot, follow these steps:
- Log in to your Comm100 Control Panel.
- From the left navigation pane, go to Bot > Chatbot.
- Expand the chatbot drop-down list and click Manage on the Manage Chatbots area.
- On the Chatbots drawer, click New Third-party Chatbot.
- On the New Third-party Chatbot drawer, complete the Chatbot settings including Chatbot name, engine, webhook target URL, and channel. The Chatbot's engine, language, and Channel cannot be changed once it's created.
- Click Save. Your Chatbot is created successfully.
- To deploy the bot, assign the newly created bot to a Campaign. To learn the detailed steps, see this article.
When an event (Chat Joined/Question Asked/Intent Clicked/Location Shared/Form Submitted) occurs in Comm100 Live Chat, we will pass the information to the bot via webhook so that your bot can handle the chat request. Your bot will then have to process the information using its own Bot Engine and send a response to Comm100 so that we can display the bot’s answers to your visitors. The data format type of the request and response is JSON. Please refer to this Third-Party Bot Connection Guide for more detailed info.
The following shows a sample data that Comm100 sends to your webhook URL:
{
"event":0,
"chatId":"nocn7iKiekCiMG0IrzaEYw",
"campaignId":3663,
"question":"Visitor sent a message",
"visitorInfo":{
"id":21,
"pageViews":2,
"browser":"Google Chrome 72.0.3626.119",
"chats":8,
"city":"Vancouver",
"company":"",
"country":"Canada",
"currentBrowsing":"https://ent.comm100.com/livechatfunc/PlanPreview.aspx?codePlanId=3663&siteId=1000298&ssl=1",
"customFields":[
],
"customVariables":[
],
"department":-1,
"email":"walidtest@comm100.com",
"firstVisitTime":"0001-01-02T18:58:13.661673",
"flashVersion":"",
"ip":"xx.xx.xxx.234",
"keywords":"",
"landingPage":"https://ent.comm100.com/livechatfunc/PlanPreview.aspx?codePlanId=1480&siteId=1000298&ssl=1",
"language":"en-US",
"name":"test",
"operatingSystem":"Windows 10",
"phone":"",
"productService":"",
"ticketId":"",
"referrerUrl":"https://ent.comm100.com/LiveChat/agentConsole.aspx?siteId=1000298",
"screenResolution":"1680x1050",
"searchEngine":"",
"state":"British Columbia",
"status":2,
"timeZone":"GMT 00:00",
"visitTime":"2019-03-04T09:06:38.4622821Z",
"visits":7,
"ssoId":"",
"chatRequestingPageUrl":"https://ent.comm100.com/livechatfunc/PlanPreview.aspx?codePlanId=xxx&siteId=xxx&ssl=1",
"segments":[
339
]
}
}
The following shows a sample JSON response you should send to Comm100:
[
{
"type": "text",
"content": {
"message": "this is a plain message"
}
},
{
"type": "text",
"content": {
"message": "this is a web link message",
"link": [{
"type": "hypelink",// hypelink or goToIntent.
"startPosition": 10,
"endPosition": 17,
"ifPushPage": true,
"url": "www.test.com",
"openIn": "currentWindow"// currentWindow, sideWindow or newWindow.
}]
}
},
{
"type": "text",
"content": {
"message": "this is a go to intent message",
"link": [{
"type": "goToIntent",
"startPosition": 10,
"endPosition": 17,
"intentId": "test-intent-id",
"displayText": "test-displayText"
}]
}
},
{
"type": "image",
"content": {
"description": "description of the image",
"url": "www.test.com/test-image.jpg"
}
},
{
"type": "video",
"content": {
"url": "www.test.com/test-video.jpg"
}
},
{
"type": "quickreply",
"content": {
"message": "this is a quick reply response",
"items": [
{
"type": "goToIntent",// goToIntent, contactAgent or text.
"name": "click to trigger test-intent-name",
"intentId": "test-intent-id"
},
{
"type": "contactAgent",
"name": "click to contact agent"
}
]
}
},
{
"type": "button",
"content": {
"message": "this is a button response",
"items": [
{
"type": "goToIntent",// goToIntent, hyperlink or webview.
"text": "click to trigger test-intent-name",
"intentId": "test-intent-id"
},
{
"type": "hyperlink",
"text": "click to open this url in web page",
"url": "www.test.com",
"openIn": "currentWindow"
},
{
"type": "webview",
"text": "click to open this url in web view",
"url": "www.test.com",
"webviewOpenStyle": "full"
}
]
}
},
{
"type": "location",
"content": null
},
{
"type": "form",
"content": {
"text": "book ticket",
"message": "please fill the form below",
"ifNeedConfirm": true,
"fields": [
{
"type": "text",// text, textArea, radio, checkBox, dropDownList or checkBoxList
"name": "field-1",
"value": "field-value-1",
"ifRequired": true,
"ifMasked": true
},
{
"type": "dropDownList",
"name": "field-2",
"value": "field-value-2",
"ifRequired": true,
"ifMasked": true,
"options": [
"value": "field-1-value",
"value": "field-2-value",
"value": "field-3-value"
]
}
]
}
}
]