KustomerCore.createConversation()
Creates a new session in Kustomer so you can start sending messages.
First, initialize chat
You must initialize with
KustomerCore.init()
before you can execute any additional Core SDK methods
Examples
kustomerCore.createConversation(
{
title: 'Conversation Title',
assistant: 'SOME_ASSISTANT_ID',
brand: 'SOME_BRAND_ID',
lang: 'en',
},
(response, error) => {
console.log('Session was created!');
})
);
Syntax
KustomerCore.createConversation(options, function(callbackResponse, error))
Parameter | Type | Description |
---|---|---|
options | Object | Optional These are options that you can pass in to modify the created session. All possible options are listed below. |
function(callbackResponse, error) | Function | Optional A callback that is run after KustomerCore.createConversation() completes.callbackResponse is an object returned to the callback function. See the callbackResponse section below to see the properties of the object.error is either undefined or a native JavaScript Error object. |
options
options
Property | Type | Description |
---|---|---|
title | String | Required The title or subject line of the conversation. Limited to 256 characters. |
brand | String | Required The brand that the conversation belongs to. |
assistant | String | Optional The conversational assistant being used in the conversation. |
lang | String | Optional The lang code that the created conversation should be set to. |
callbackResponse
callbackResponse
Property | Type | Description |
---|---|---|
conversationId | String | Required The conversation unique ID |
createdAt | String | Required The conversation's created at timestamp |
ended | Boolean | Required Whether or not the conversation is ended. |
isInAssistantMode | Boolean | Whether or not the conversation is still in assistant mode. |
Updated over 3 years ago