There are system variables on the platform that can be used in any script. You do not need to declare system variables and write data into them - you can use them in your scripts immediately.
When specifying variables, curly braces should be used only when specifying variables in messages that are played by the bot. In other cases curly braces are not used.
| Title | Description |
|---|---|
{now} |
In a call, the variable returns the date and time according to the time zone of the customer number, and in a chat, it returns the date and time according to UTC world time. |
{dialogId} |
Returns a string containing the identifier of the current dialog. |
{dialog} |
Returns a string containing the full text of the dialog. |
{previousBotId} |
Returns the ID of the scenario from which the system redirected the bot to another scenario during a dialog with the user. |
{today} |
Returns the date without specifying a time (for example, 2023-11-16). The current date is determined during the dialog with the client. |
{time} |
Returns the subscriber's time without specifying a date (for example, 15:53:12). In a chat the time is determined by UTC+0, in a call - by the time zone of the subscriber. |
{phone} |
Returns the phone number of the client with whom the bot is currently communicating. The variable works for both outgoing and incoming calls, and contains the number that is used in the current call. |
{recordPath} |
Returns a reference to the audio recording of the current dialog in telephony. |
{percept} |
Returns a string with the client's last answer to the bot's question. |
{tryNumber} |
Returns the number of dialing attempts within the dialing job. |
{company.now} |
Returns the date and time, taking into account the time zone in which the company is located (for example, 2023-11-17 13:06:58). The current date and time are determined during the dialog with the client. |
{company.today} |
Returns the date without time (for example, 2023-11-17). The time zone in which the company is located is taken into account. The current date is determined during the dialog with the client. |
{company.time} |
Returns the time without specifying the date (for example, 13:06:58). The time zone in which the company is located is taken into account. The current time is determined during the dialog with the client. |
{companyId} |
Returns a string with the ID of the company to which the bot belongs. |
{botId} |
Returns a string containing the bot's identifier. |
{referer} |
Returns a string with the address of the main page of the site where the widget is placed (allows the operator to understand from which site the user writes). |
{utcNow} |
Returns the date and time in UTC time zone. |
{utcTime} |
Returns the time in UTC time zone. |
{utcToday} |
Returns the date in UTC time zone. |
{messengerUserId} |
Returns the ID of the user's messenger account. |
{communicationType} |
String, type of communication with the client. Valid values: TEXT, VOICE. |
{channelType} |
String, type of communication channel. Valid values: WEB, MOBILE, MESSENGER. |
{messenger} |
String, type of messenger. Valid values: WHATSAPP, VIBER, TELEGRAM, FACEBOOK, SLACK, THREADS. |
{clientLastAnswerTime} |
Returns the time of the user's last response to the bot's question. The value is displayed as a Unix timestamp1. |
{botLastAnswerTime} |
Returns the time of the last bot response in seconds. The value is displayed as a Unix timestamp1. |
{clientId} |
Returns a string with the internal client identifier in the TWIN system (uuid). |
{clientPhone} |
Returns a string containing the customer's phone number. |
{clientEmail} |
Returns a string containing the customer's email address. |
{clientName} |
Returns a string containing the client's name. |
{clientNickname} |
Returns the client's name (nickname) in the messenger in which the client communicated with the bot. |
{clientExternalId} |
Returns a string with the external identifier of the client in the system. |
{clientMetadata} |
An array containing any customer data (specified in the following format: { “{firstName}”: “John”, “{middleName}”: “David”, “{”{lastName}": “Smith”}). |
tryCandidate |
The number of attempts to reach the candidate, counted from 0. |
answeredCandidate |
The number of dial-ins to the candidate, counted from 0. |
resultCandidate |
The number of successful calls to the candidate, counted from 0. |
humanCandidate |
The number of dials to a candidate where the person who answered was not an answering machine is counted from 0. |
answeredNumber |
The number of dials by the candidate number, counted from 0. |
humanNumber |
The number of dials to a candidate number where the person who answered was not an answering machine is counted from 0. |
resultNumber |
The number of successful dials by the candidate number, counted from 0. |
nodeId |
The ID of the current block. Returns the ID of the block where the script is being executed. Used for debugging purposes. Read-only. |
1A Unix timestamp (for example, 1658125300) displays the number of seconds that have passed since January 1, 1970 (00:00:00 UTC).