KustomerCore.endConversation()

End a conversation

👍

First, initialize chat

You must initialize with KustomerCore.init() before you can execute any additional Core SDK methods

Examples

// end a conversation
KustomerCore.endConversation({
  conversationId: 'SOME_ID
}, function (res, error) {
  console.log('conversation ended');
});

Syntax

KustomerCore.endConversation(options, function(callbackResponse, error));
ParameterTypeDescription
optionsObject

Required

An object containing the property conversationId

callbackResponseObject

Optional

A callback that is run after method completion.

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.

callbackResponse

PropertyTypeDescription
conversationIdString

Required

The conversation that you ended.

createdAtString

Required

The time of creation of the conversation

endedBoolean

Required

Whether or not the conversation is ended.

📘

Turn on setting in Kustomer

From the Kustomer app, you must also go to Apps > Chat > Settings tab and select the Allow chats to be ended option. Chats will not be ended unless you turn this setting on.