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.
chatHistoryThis method returns the history of user and bot interactions within the current session.
contextThis method returns an object which represents the current request context.
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.