KustomerCore.initAssistant()
Fetch the details of a conversational assistant so you can initialize
First, initialize chat
You must initialize with
KustomerCore.init()
before you can execute any additional Core SDK methods
Examples
// Initialize an assistant
KustomerCore.initAssistant({
assistant: 'SOME_ASSISTANT_ID',
}, function (initAssistantPayload, error) {
console.log('Started assistant!');
});
Syntax
KustomerCore.initAssistant(options, function(callbackResponse, error))
Parameter | Type | Description |
---|---|---|
options | Object | Optional An options object allowing you to modify this method call. All possible options are listed below. |
function(callbackResponse, error) | Function | Optional A callback that is run after callbackResponse is an object returned to the callback function. See the error is either |
callbackResponse
callbackResponse
Property | Type | Description |
---|---|---|
assistant | String | Required The assistant unique ID. |
dialog | String | Required The assistant dialog unique ID. |
node | String | Required The assistant node unique ID. |
initialMessages | Array | Required An array of initial messages of the conversational assistant. See below for the structure of what one of these initial messages in the array looks like |
attributes | Object | Required An object containing information about the assistant. Example:
|
initialMessages
initialMessages
// initialMessages
[
{
meta: {
template: Object
},
direction: String,
directionType: String,
importedAt: String,
trackingId: String,
lang: String,
}
]
Updated over 1 year ago