getChatLog()

Returns the chat log of a chat associated with a specific chat key. Available in API version 29.0 or later.

NameTypeDescription
chatKeyStringThe chatKey associated with the chat for which to retrieve the chat log.
callbackfunctionJavaScript method called upon completion of the method.

This method is asynchronous so it returns its response in an object in a callback method. The response object contains the following fields:

NameTypeDescription
customEventsArray of customEvent objectsAn array of custom event objects representing the custom events that occurred during a chat.
messagesArray of message objectsAn array of chat message objects containing all of the chat messages from the chat log.
successBooleantrue if getting the chat log was successful; false if getting the chat log wasn’t successful.

The customEvent object contains a single event from the chat log and the following properties:

PropertyTypeDescription
sourceStringThe person who initiated the custom event, either the chat visitor or the agent.
typeStringThe type of custom event that occurred.
dataStringThe data of the custom event that was sent to the chat; corresponds to the data argument of the liveagent.chasitor.sendCustomEvent() method used to send this event from the chat window.
timestampDate/TimeThe date and time a custom event was received.

The message object contains a single chat message from the chat log and the following properties:

PropertyTypeDescription
contentStringThe text content of a message in the chat log.
nameStringThe name of the user who sent the message in the chat log. This appears exactly as it is displayed in the chat log.
typeStringThe type of message that was received, such as Agent or Visitor.
timestampDate/TimeThe date and time the chat message was received.