Developer Docs | Kommunicate

Developer Docs | Kommunicate

  • Book a Demo
  • Try For Free

›Web

Web

  • Installation
  • CMS Installation
  • Authentication
  • Conversation
  • Conversation Assignment
  • Customization
  • Localization
  • Logout
  • Troubleshooting

Android

  • Installation
  • Authentication
  • Push Notification
  • Conversation
  • Customization
  • Localization
  • Logout
  • Migration
  • Troubleshooting

iOS

  • Installation
  • Authentication
  • Push Notification
  • Conversation
  • Customization
  • Configuration
  • Localization
  • Logout
  • Troubleshooting

React Native

  • Installation
  • Expo Installation
  • Authentication
  • Push Notification
  • Conversation
  • Customization
  • Logout
  • Troubleshooting

Flutter Mobile

  • Installation
  • Authentication
  • Push Notification
  • Conversation
  • Customization
  • Localization
  • Troubleshooting

Flutter Web

  • Installation
  • Authentication
  • Conversation

Ionic/Cordova

  • Installation
  • Authentication
  • Push Notification
  • Conversation
  • Customization
  • Localization
  • Logout
  • Resolving Errors

Ionic/Capacitor

  • Installation
  • Authentication
  • Push notification
  • Customization

Rich Messages

  • How To Use
  • Types of Rich Messages

Bots

  • Bot setup
  • Dialogflow Integration
  • Lex Integration
  • Kompose Bot Builder
  • IBM Watson Integration
  • Custom Bot Integration
  • Import Kompose Bot
  • Bot Samples

Integrations

  • Zapier
  • WhatsApp
  • WhatsApp 360Dialog
  • WhatsApp Twilio
  • WhatsApp Cloud API
  • Instagram Integration
  • Telegram Integration
  • Sunshine Integration
  • Freshdesk Integration
  • Pipedrive Integration
  • Agile Integration

Platform APIs

  • Authentication
  • Endpoints

Dashboard Features

  • Analytics
  • Conversations
  • Users
  • Bot Integration
  • Helpcenter
  • Campaign Messaging
  • Settings

Configuration

  • Single Sign On (SSO) Setup
  • Webhooks
  • Access Token URL
  • Email Fallback

Conversation

Overview

This section is dedicated to launching and managing conversations in the chat widget on certain triggers. For example, the chat widget will only appear on the website on click of a specific button. This could be useful if you wish to show support chat only on certain triggers and not all the time.

Conversations

Conversation Settings

Kommunicate provides some parameter to configure the conversation rules when it is created. These parameters can be used to override the conversation rules you have set from dashboard. These parameters can be set using the Kommunicate.updateSettings() methods. The updated setting will be effective from the next conversation user creates by either clicking on the Start new conversation on chat widget or calling the Kommunicate.startConversation().

Below is the sample code to update the conversation setting:

var defaultSettings = {
    "defaultAgentIds": ["<AGENT_ID>"],
    "defaultBotIds": ["<BOT_ID>"], // Replace <BOT_ID> with your bot ID which you can find in bot section of dashboard
    "defaultAssignee": "<BOT_ID>", // Replace <BOT_ID> with your bot ID which you can find in bot section of dashboard
    "skipBotEvent": '["<EVENT_NAME>"]', // Replace <EVENT_NAME> with the bot platform event names which you want to skip
    "skipRouting": true,
    "teamId": <TEAM_ID> // Replace <TEAM_ID> with with team ID which you can find in teammates section of dashboard
};    
Kommunicate.updateSettings(defaultSettings);  

Below is the detail about the supported parameters:

ParametersTypeDefault valueDescriptions
defaultAssigneestringConfigured routing rules for agents from dashboardYou need to pass the agentId/botId. If nothing is passed the default agent will automatically get selected.
NOTE: You need to pass "skipRouting": true with defaultAssignee parameter if you have assigned a default assignee from the conversation rules section
defaultAgentIdsarrayConfigured routing rules for agents from dashboardYou can pass the default agents that you want to be present in every new conversation created.
defaultBotIdsarrayConfigured routing rules for bots from dashboardYou can pass the default bots that you want to be present in every new conversation created.
WELCOME_MESSAGEstringConfigured from dashboardYou can pass the default welcome message here and it will override the welcome message which you have set from dashboard.
NOTE: It will not override the welcome message sent by your bot.
skipRoutingbooleanfalseIf you pass this value true then it will skip routing rules set from conversation rules section.
skipBotEventarrayNoneYou can pass the bot event names that you want to skip in every new conversation created. Read more about bot events here
teamIdnumberAll conversations will be assigned to default team.Assign conversations to a particular team by passing teamId and the conversation assignment will be based your assigned team rules.
Get team ID from teammates section

Example : Assigning conversations to a specific bot/agent on certain events

Usecase: A user comes to your website and starts a conversation with support agents. When user navigates to another page you wants to start conversation with another agents or bots. You can achieve this by updating the conversation rules dynamically. Set the appropriate values in above mentioned parameters and Kommunicate will use these parameters while creating the conversation. You can update the empty values when user navigate to previous page to make old conversation rules(set from dashboard) effective. Below is the sample code for the same:


// Example : Adding bot as a default assignee 
var defaultSettings = {
    "defaultAgentIds": ["<AGENT_ID>"], // Optional. Replace <AGENT_ID> with agents email id. Include this parameter if you want to assign the conversation to an agent.
    "defaultBotIds": ["<BOT_ID>"], // Optional. Replace <BOT_ID> with your bot ID which you can find in bot section of dashboard. Include this parameter if you want to assign the conversation to a bot.
    "defaultAssignee": "<ASSIGNEE_ID>", // Replace <ASSIGNEE_ID> with your bot/agent ID  whom you're assigning the conversation.
    "skipRouting": true
};
Kommunicate.updateSettings(defaultSettings);  

Launch conversation List

To launch the chat widget and conversation list, use the following method.

Kommunicate.launchConversation();

How it works ?

  1. Initially, if there are no previous conversations, then it will create a new conversation and open it.
  2. If you have old/previous conversations, it will open the conversation list.

Assign different bot to different website pages

In order to change widget's default settings like default bots in conversation and default assignee, you need to create defaultSettings object with two parameters, defaultBotIds containing list of bot ids which you wish to add in conversation, defaultAssignee having string value to the agent/bot which you wish to assign conversation by default.

(function(d, m){
    /*---------------- Kommunicate settings start ----------------*/
    var defaultSettings = {
    "defaultBotIds": ["<BOT_ID>"], // Replace <BOT_ID> with your bot ID which you can find in bot section of dashboard
    "defaultAssignee": "<BOT_ID>", // Replace <BOT_ID> with your bot ID which you can find in bot section of dashboard
    "skipRouting":true
    };
    var kommunicateSettings = {
        "appId":"<APP_ID>",  // Replace <APP_ID> with your APP_ID which you can find in install section of dashboard
        "automaticChatOpenOnNavigation":false,
        "onInit": function() {
            Kommunicate.updateSettings(defaultSettings); 
        }
    };
    /*----------------- Kommunicate settings end ------------------*/
    var s = document.createElement("script");
    s.type = "text/javascript"; s.async = true;
    s.src = "https://widget.kommunicate.io/v2/kommunicate.app";
    var h = document.getElementsByTagName("head")[0];
    h.appendChild(s);
    window.kommunicate = m;
    m._globals = kommunicateSettings;
})(document, window.kommunicate || {});

Initiate conversation with specific team

To start a conversation with a specific team, one can create defaultSettings object with teamId parameter. These parameters can be set using the Kommunicate.updateSettings() method.

Below is the sample code to update the conversation setting:

(function(d, m){
    var defaultSettings = {
    "teamId": "<TEAM_ID>" // Replace <TEAM_ID> with with team ID which you can find in teammates section of dashboard
    };
    var kommunicateSettings = {
        "appId":"<APP_ID>",  // Replace <APP_ID> with your APP_ID which you can find in install section of dashboard
        "automaticChatOpenOnNavigation":false,
        "onInit": function() {
            Kommunicate.updateSettings(defaultSettings); 
        }
    };
    var s = document.createElement("script");
    s.type = "text/javascript"; s.async = true;
    s.src = "https://widget.kommunicate.io/v2/kommunicate.app";
    var h = document.getElementsByTagName("head")[0];
    h.appendChild(s);
    window.kommunicate = m;
    m._globals = kommunicateSettings;
})(document, window.kommunicate || {});

Create a new conversation

A conversation can be created using startConversation method. Below is the example code for the same. You can choose to define certain parameters to profile this conversation and allot assignee.

// Below function will create a conversation using default conversation rules.  
Kommunicate.startConversation(); 

Note: You have to set "automaticChatOpenOnNavigation" parameter to false as this option won't be compatible with startConversation method.

// Below function will create a conversation using parameters which you're passing in conversationDetail variable.  
var conversationDetail = {
    "defaultGroupName": "<DEFAULT_GROUP_NAME>", // Optional. To give a specific title to the conversation, replace "<DEFAULT_GROUP_NAME>" with the title you prefer. By default, the group title will be the name of the conversation assignee.
    "agentIds": ["<AGENT_ID>"], // Optional. If you do not pass any agent ID, the default agent will automatically get selected.
    "botIds": ["<BOT_ID>"], // Optional. Pass the bot IDs of the bots you want to add in this conversation.
    "skipRouting":"true", // Optional. If this parameter is set to 'true', then routing rules will be skipped for this conversation.
    "assignee":"<BOT_ID> or <AGENT_ID>" // Optional. You can assign this conversation to any agent or bot. If you do not pass the ID. the conversation will assigned to the default agent.
    "conversationMetadata": {
            "key1": "value1",
            "key2": "value2",
        }, // Optional. If any metadata needs to be add in the conversation.
};
Kommunicate.startConversation(conversationDetail, function (response) {
    console.log("new conversation created");
});                    

Note: If called with empty parameters it will inherits the conversation rules from conversation settings object. It can be helpful to set conversation rules dynamically. Refer to below example :

var defaultSettings = {
    "defaultBotIds": ["<BOT_ID>"], // Optional. Replace <BOT_ID> with your bot ID which you can find in bot section of dashboard
    "defaultAssignee": "<BOT_ID>", // Optional. Replace <BOT_ID> with your bot ID which you can find in bot section of dashboard
    "skipRouting": true
};
Kommunicate.updateSettings(defaultSettings); 

//Pass the empty parameter to use the default conversation setting.  
Kommunicate.startConversation(); 

Open a particular conversation

If you wish to open a particular conversation, pass the group ID of that conversation by using the method mentioned below:

Kommunicate.openConversation(<GROUP_ID>);

Open chat window when a new message comes

If you want the chat window to pop open when a new conversation comes, add "openConversationOnNewMessage": true in kommunicateSettings object. This will open the chat window when a new message comes.


    var kommunicateSettings = {
        ...
        "appId": "<APP_ID>",
        "openConversationOnNewMessage":true
        ...
    };


Start a new session every time a user visits again

Kommunicate expires the user session if a user is anonymous and inactive for 30 days. If a user comes back to your website within 30 days then the old conversations of the user will be visible. If you want to start a new session every time user comes to your website then change the settings in the kommunicate dashboard where all the existing info and previous messages will be removed from the chat widget after a set period of time.

Conversation Info

Pass the conversation information as a JSON metadata, this will be displayed to the human agents on the Kommunicate dashboard.

Examples below:

A car marketplace support chat inquiry about a car model will pass the additional details about the car model.

Below is the function to update the conversation info:


    var conversationInfo = 
        {
          groupId: "<GROUP_ID>",  //Replace <GROUP_ID> with your <GROUP_ID> value
          metadata: {
              "key1": "value1",
              "key2":"value2"
          }
        };
Kommunicate.updateConversationMetadata(conversationInfo);

Note: "GROUP_ID" can be fetched from "KommunicateGlobal.CURRENT_GROUP_DATA.tabId".

← AuthenticationConversation Assignment →
  • Overview
  • Conversations
    • Conversation Settings
    • Launch conversation List
    • Assign different bot to different website pages
    • Initiate conversation with specific team
    • Create a new conversation
    • Open a particular conversation
    • Open chat window when a new message comes
    • Start a new session every time a user visits again
    • Conversation Info

Ready to automate more than 80% of your customer support?

Try for Free
  • support@kommunicate.io
  • United States
    (+1) (310) 402-2374
  • India
    (+91) 974-057-0196
  • Learn
    • iOS Chatbot
    • Amazon Lex Chatbot
    • Chatbot in Android
    • ChatGPT with Flutter
    • Document to Chatbot
    • React Native Chatbot
    • Create Flutter Chatbot
    • Whatsapp Business API
    • Integrate React Js Chatbot
    • Whatsapp Chatbot Using NodeJs
    • Integrate ChatGPT With Whatsapp
    • Integrate Dialogflow With Whatsapp
    • ChatGPT For Product Engagement
    • Product
    • AI Chatbot Builder
    • Generative AI Chatbot
    • Customer Experience
    • Chatbot Features
    • Dialogflow Integration
    • FAQ Chatbot
    • Live Chat
      Industries
    • Healthcare Chatbot
    • E-commerce Chatbot
    • Education Chatbot
    • Banking Chatbot
  • Integrations
    • E-commerce Chatbot Integration
    • Omnichannel Chatbot
    • Chatbot Integration
    • Chatbot for Website
    • Mobile Apps Chatbot
    • Chatbot for CRM's
    • Automation and Analytics
    • Zendesk Chatbot Integration
  • Resources
    • Chatbots Templates
    • Case Studies
    • Whitepapers
    • Chatbot Guide
    • Videos
    • Knowledge Hub
    • Comparisons
    • ROI Calculator
    • Blogs
    • Company
    • Partner Program
    • Affiliate Program
    • Pricing
    • About Us
    • Media
      Support
    • Contact Us
    • HelpCenter
    • Stack Overflow
    • API Status
  • Comapare
    • Kommunicate Vs Verloop
    • Kommunicate Vs Intercom
    • Kommunicate Vs Yellow
    • Kommunicate Vs Twak
    • Kommunicate Vs Ada
Arabic
Hindi
Spanish
French
German
Portuguese
Urdu
Software Advice Frontrunners for Live Chat Mar-22Software Advice Frontrunners for Live Chat Mar-22crozdesk badgeISO certificationHIPAA complianceGDPR compliant - GDPR Copy 12Created with Sketch.COMPLIANT
Copyright © 2025 Kommunicate.io.
T&C Privacy Policy Career SLA DPA Sitemap