Conversation
Launching chat screen
You can open the chat screen by calling the below function:
kommunicate.launchConversation((response) => {
//conversation launched successfully
}, (response) => {
//conversation launch failed
});
Launching individual chat thread
You can open an individual chat thread by calling the below function and passing the groupId
:
let convObj = {
'clientChannelKey' : clientChannelKey, //pass the clientChannelKey here
'takeOrder' : true //skip chat list on back press, pass false if you want to show chat list on back press
};
kommunicate.launchParticularConversation(convObj, function(response) {
//Conversation launched successfully
}, function(response) {
//Conversation launch failed
});
Starting a new Conversation
You can start a new conversation by using the below function:
let convInfo = {
'agentIds':['reytum@live.com'], //list of agentIds
'botIds': ['Hotel-Booking-Assistant'] //list of botIds
};
kommunicate.startNewConversation(convInfo, (response) => {
//You can launch the particular conversation here, response will be the clientChannelKey
console.log("Kommunicate create conversation successfull : " + response);
},(response) => {
console.log("Kommunicate create conversation failed : " + response);
});
Starting a Unique Conversation
You can create a unique conversation using the below method. A unique conversation is identified by the list of agentIds and botIds used to create the conversation. If the same set of Ids are passed to the below method, then the already created conversation would be returned instead of creating a new conversation:
var vary = {
'agentIds':['reytum@live.com'],
'botIds' : ['bot1', 'bot2']
};
kommunicate.startOrGetConversation(vary, (response) => {
console.log("Kommunicate create conversation successfull : " + response);
},(response) => {
console.log("Kommunicate create conversation failed : " + response);
});