KustomerCore.getConversations()

Fetches the conversations in history

👍

First, initialize chat

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

Examples

// Get conversations
KustomerCore.getConversations();


// Get conversations with a callback
KustomerCore.getConversations({}, function (res, error) {
  console.log('Fetched conversations!', res.conversations);
});

Syntax

KustomerCore.getConversations(options, function(callbackResponse, error))
ParameterTypeDescription
optionsObjectOptional

These options allow you to configure the page and page size of the response.
function(callbackResponse, error)FunctionOptional

A callback that is run after KustomerCore.getConversations() 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

PropertyTypeDescription
pageNumberOptional

The page of conversations that you want returned.
pageSizeNumberOptional

The page size that you want returned. The default is 100.

callbackResponse

PropertyTypeDescription
conversationsArrayRequired

A list of conversation objects. See conversations below for details.
pagesObjectRequired

This is an object giving details about the page you are on, that looks like this:

{ current: Number, first: Number, next: Number, previous: Number }

conversations

The following table shows you what each object looks like in the conversations array.

PropertyTypeDescription
conversationIdStringRequired

The unique identifier for the conversation.
createdAtStringRequired

The time the conversation was created.
previewStringRequired

Preview text for the conversation.
isInAssistantModeBooleanOptional

Tells you whether the conversation is currently in assistant mode or not
lastMessageAtStringRequired

The time of the last message in the conversation.
endedBooleanOptional

Tells you whether the conversation has been ended or not.