Вы просматриваете старую версию данной страницы. Смотрите текущую версию.

Сравнить с текущим просмотр истории страницы

« Предыдущий Версия 9 Следующий »

There are built-in variables on the TWIN platform that can be used in various scenarios:

Unfortunately, it is not possible to use your own dot variables:

{your.variable}

This construction will not work. This is the only limitation in variables, since "." points to a system variable.

{system.variable}

System variables used on the platform.

  • {system.now}, the analogue is a variable {now} - Date with time (for example 2019-11-22 04:06:58). The current date is used when the script was used.
  • {system.today}, the analogue is a variable {today} - Date without time (for example, 2019-11-22). The current date is used when the script was used.
  • {system.time}, the analogue is a variable {time} Time without date (for example 04:06:58). The current time is used at the moment of using the script.
  • {system.telephone} Subscriber’s number used in the script when making a call via phone.
  • {system.previous} Script number. You can use such conditions during the transition between scripts to know where the transition was made from.
  • {system.dial} Counter of successful calls to the candidate within the call task.
  • {system.record} Sends a link to a sound recording of the current conversation via phone (now only on the TWIN platform, the recording format is .mp3).

{detector.emotions}

Determination of the emotional coloring of a person's answer. There are 3 types: 

  • negative - negative coloring
  • positive - positive coloring
  • neutral - neutral emotionality

{detector.gender}

Determination of gender by voice. Only available in calls. For this variable to work, it is required to check "Determination of gender characteristic" in the call task. Possible values

To determine the gender, the system needs at least 1 second of the client's clear voice, otherwise the system will not recognize anything.

  • male -male
  • female - female
  • unsure - the system could not come to an unambiguous decision
  • unknown - could not be detected or emotion detection is disabled / not supported

Variable values that do not change during the dialogue

  • {companyId} is a string, company ID which the bot belongs to.
  • {botId} is a string, bot ID.
  • {dialogId} is a string, current dialog ID.
  • {dialog} is an object, when inserting into a line, is automatically transformed into the dialog text.
  • {referer} is a string, URL where the user came from (used for chats).

Client information (Twin end user, dialogue participant)

Information can be changed during the dialogue using the client identification endpoint (it is available both in chats and in the bot service).

  • {clientId} is a string, client ID in Twin system.
  • {clientPhone} is a string, client phone number.
  • {clientEmail} is a string, client email address.
  • {clientName} is a string, client name.
  • {clientNickname} is a string, client nickname.
  • {clientExternalId} is a string, user ID in the Twin client system, must be unique within the company.
  • {clientMetadata} is an array, any data about the client.

Data that can be changed only when switching from a call to a chat, or vice versa

(So far, this functionality is not available in full, because CIS has not been launched. At the moment, you can use it, for example, to determine in which messenger the dialogue is being conducted):

  • {communicationType} is a string, client communication type. Valid values: TEXT, VOICE.
  • {channelType} is a string, communication channel type. Valid values: WEB, MOBILE, MESSENGER.
  • {messenger} is a string, messenger type. Valid values: WHATSAPP, VIBER, TELEGRAM, VKONTAKTE, FACEBOOK, SKYPE, SLACK, YANDEX, ALICE, THREADS.

Data that changes automatically each time you address the bot

  • {percept} is a string that stores a phrase said by the user and which the bot is currently responding to.
  • {clientLastAnswerTime} is an integer, time of the client's last phrase in seconds.
  • {botLastAnswerTime} is an integer, the time of the last bot's response in seconds.

Variables will be updated in this article as they appear on our platform.

  • Нет меток