Skip to main content

$jsapi.chatHistory

The $jsapi.chatHistory() method returns the dialog history of the current session in a simplified format. A history is a list of various messages:

  • user requests;
  • events;
  • bot reactions;
  • agent messages.
tip

To get the detailed dialog history in the JSON format, use the chatHistoryJson method.

How to use

The method is called without arguments:

state: history
q: dialog history
a: {{ $jsapi.chatHistory() }}

The method returns a string in the format:

CLIENT
[User request]

BOT
[First bot reply]
[Second bot reply]

[...]