Kustomer.describeConversation()

Update information about a conversation in Kustomer.

πŸ‘

First, initialize chat fully

Kustomer Chat must finish initializing fully with Kustomer.start() before you can execute any additional Web SDK methods.

Tip: Call other methods inside the callback of Kustomer.start() to ensure Kustomer Chat always completes initialization before the code tries to run other methods.

To learn more, see Troubleshooting: Kustomer method calls won't execute.

Examples

We're provided some examples of how you can call Kustomer.describeConverstion():

// Describes a conversation when a conversation is created
Kustomer.addListener('onConversationCreate', (res) => {
  Kustomer.describeConversation({
    conversationId: res.conversationId,
    customAttributes: {
      some_custom_attribute: 'some_custom_value'
    }
  });
});

Kustomer.describeConversation({
  conversationId: 'some_conversation_id',
  customAttributes: {
    some_custom_attribute: 'some_custom_value'
  }
});

Kustomer.describeConversation({
  conversationId: 'some_conversation_id',
  customAttributes: {
    some_custom_attribute: 'some_custom_value'
  }
}, function (callbackResponse, error) {
  if (!error) {
    console.log('Updated information about the conversation');
  }
});

Syntax

Kustomer.describeConversation(options, function(callbackResponse, error))
ParameterTypeDescription
optionsObjectRequired

An object containing all the properties you want to update on the conversation inside Kustomer. A breakdown of the options object is listed below.
function(callbackResponse, error)FunctionOptional

A callback that is run after Kustomer.describeConversation() 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
conversationIdStringRequired

The conversation's unique ID in Kustomer's database.
customAttributesObjectRequired

An object containing the custom attributes of the conversation.

πŸ“˜

customAttributes

Before you can update a custom attribute with Kustomer.describeConversation(), the custom attribute must first exist on the Customer Klass in your Kustomer organization.

You can learn more about Klasses and custom attributes in the Kustomer Help Center.

{
  conversationId: 'some_conversation_id',
  customAttributes: {
    some_custom_attribute: 'some_custom_value',
    some_custom_attribute2: 'some_custom_value2'
  }
}

callbackResponse

PropertyTypeDescription
conversationIdStringRequired

The conversation's unique ID in Kustomer's database.
customObjectOptional

An object containing the custom attributes of the conversation.

{ some_custom_attribute: 'some_custom_value' }