Skip to main content

$jsapi

The $jsapi built-in service includes various system methods.

Methods

Common methods

MethodDescription
bindThis method is used for setting up handlers.
chatHistoryThe method returns the dialog history of the current session in a simplified format.
chatHistoryJsonThe method returns the detailed dialog history of the current session in the JSON format.
context

This method returns an object which represents the current request context.

With this method, you can access the built-in variables in JS actions and in those JS files that are executed in ECMAScript 5.
getCustomTagsThe method returns an array of action tags that are used in the script.
getStatesThe method returns the script structure: detailed information about each state and theme.
randomThis method returns a random integer number in the specified range.
resolvePathThis method converts relative state paths to absolute ones.
versionThe method returns metadata about the current version of JAICP.

Current time retrieval methods

MethodDescription
currentTimeThis method returns the current Unix time in the UTC time zone.
dateForZoneThis method returns the current date and time in the specified format.
timeForZoneThis method returns the current Unix time in the specified time zone.

Session control methods

MethodDescription
startSessionThis method starts a new session.
stopSessionThis method stops the current session.
newSessionDeprecated This method creates a new session and passes parameters to it.