Proto Variables

Proto Variables are variables that store information about the end user information from the channel, human, case or user input in a chat session. The following are the list of variables that can be use in the chatbot. You can use the { } delimiter to print out the value of the variable in the bot message.

Requires { … } delimiter

  • Bot Message
  • Carousel
  • Create Case
  • Email
  • Hyperlink
  • Survey

Do not require { … } delimiter

  • Branch
  • JSON API
  • Modify Variable
Proto VariablesDescriptionExample
_user_inputVariable that stores the user input at each state of the bot. Dynamic and the value will be updated when a new input is entered.
_langVariable that stores the language detected from each user input
_gwChannel variable that store information about a channel such as the channel ID, channel type, and other additional details (different on each channels){
"id": "gw_SnAlGCfeNCcabcdefg",
"type": "website",
"details": {
"ws_auth_method": "jwt_shared_secret",
"ws_anon_allowed": true,
"webchat_settings": {},
"ws_shared_secret": "0911e5f37a93449aacc932fabcdefg",
"webchatv2_settings": {
"cards": [],
"color": "#000000",
"title": {
"de": "",
"en": "",
"es": "",
"fr": "",
"ha": "",
"id": "",
"ig": "",
"it": "",
"ja": "",
"ms": "",
"pt": "",
"th": "",
"tl": "",
"vi": "",
"yo": "",
"zh_CN": "",
"zh_TW": ""
},
"icon_id": "",
"position": "BR",
"subtitle": {
"de": "",
"en": "",
"es": "",
"fr": "",
"ha": "",
"id": "",
"ig": "",
"it": "",
"ja": "",
"ms": "",
"pt": "",
"th": "",
"tl": "",
"vi": "",
"yo": "",
"zh_CN": "",
"zh_TW": ""
},
"color_btn": "#F9C927",
"cards_title": {
"de": "",
"en": "",
"es": "",
"fr": "",
"ha": "",
"id": "",
"ig": "",
"it": "",
"ja": "",
"ms": "",
"pt": "",
"th": "",
"tl": "",
"vi": "",
"yo": "",
"zh_CN": "",
"zh_TW": ""
},
"enable_cards": false,
"mobile_width": "100%",
"enable_emojis": false,
"mobile_height": "100%",
"start_chat_btn": {
"de": "",
"en": "",
"es": "",
"fr": "",
"ha": "",
"id": "",
"ig": "",
"it": "",
"ja": "",
"ms": "",
"pt": "",
"th": "",
"tl": "",
"vi": "",
"yo": "",
"zh_CN": "",
"zh_TW": ""
},
"color_quick_reply": "#000000",
"color_notification": "#D0021B",
"prechat_form_title": {
"de": "",
"en": "",
"es": "",
"fr": "",
"ha": "",
"id": "",
"ig": "",
"it": "",
"ja": "",
"ms": "",
"pt": "",
"th": "",
"tl": "",
"vi": "",
"yo": "",
"zh_CN": "",
"zh_TW": ""
},
"prechat_form_enabled": false,
"postchat_rating_title": {
"de": "",
"en": "",
"es": "",
"fr": "",
"ha": "",
"id": "",
"ig": "",
"it": "",
"ja": "",
"ms": "",
"pt": "",
"th": "",
"tl": "",
"vi": "",
"yo": "",
"zh_CN": "",
"zh_TW": ""
},
"prechat_form_subtitle": {
"de": "",
"en": "",
"es": "",
"fr": "",
"ha": "",
"id": "",
"ig": "",
"it": "",
"ja": "",
"ms": "",
"pt": "",
"th": "",
"tl": "",
"vi": "",
"yo": "",
"zh_CN": "",
"zh_TW": ""
},
"start_chat_placeholder": {
"de": "",
"en": "",
"es": "",
"fr": "",
"ha": "",
"id": "",
"ig": "",
"it": "",
"ja": "",
"ms": "",
"pt": "",
"th": "",
"tl": "",
"vi": "",
"yo": "",
"zh_CN": "",
"zh_TW": ""
},
"postchat_rating_enabled": false,
"botmessage_rating_enabled": false,
"enable_language_selection": true,
"prechat_form_inquiry_types": [
{
"en": "Deposit",
"id": "",
"ja": "",
"th": "",
"vi": "",
"zh_CN": "Deposit"
},
{
"en": "Withdrawal",
"id": "",
"ja": "",
"th": "",
"vi": "",
"zh_CN": "Withdrawal"
}
],
"prechat_form_start_chat_btn": {
"de": "",
"en": "",
"es": "",
"fr": "",
"ha": "",
"id": "",
"ig": "",
"it": "",
"ja": "",
"ms": "",
"pt": "",
"th": "",
"tl": "",
"vi": "",
"yo": "",
"zh_CN": "",
"zh_TW": ""
},
"postchat_rating_comment_title": {
"de": "",
"en": "",
"es": "",
"fr": "",
"ha": "",
"id": "",
"ig": "",
"it": "",
"ja": "",
"ms": "",
"pt": "",
"th": "",
"tl": "",
"vi": "",
"yo": "",
"zh_CN": "",
"zh_TW": ""
},
"postchat_rating_send_btn_text": {
"de": "",
"en": "",
"es": "",
"fr": "",
"ha": "",
"id": "",
"ig": "",
"it": "",
"ja": "",
"ms": "",
"pt": "",
"th": "",
"tl": "",
"vi": "",
"yo": "",
"zh_CN": "",
"zh_TW": ""
},
"prechat_form_name_field_label": {
"de": "",
"en": "",
"es": "",
"fr": "",
"ha": "",
"id": "",
"ig": "",
"it": "",
"ja": "",
"ms": "",
"pt": "",
"th": "",
"tl": "",
"vi": "",
"yo": "",
"zh_CN": "",
"zh_TW": ""
},
"prechat_form_first_field_label": {
"de": "",
"en": "Name",
"es": "",
"fr": "",
"ha": "",
"id": "",
"ig": "",
"it": "",
"ja": "",
"ms": "",
"pt": "",
"th": "",
"tl": "",
"vi": "",
"yo": "",
"zh_CN": "Name",
"zh_TW": ""
},
"prechat_form_second_field_label": {
"de": "",
"en": "",
"es": "",
"fr": "",
"ha": "",
"id": "",
"ig": "",
"it": "",
"ja": "",
"ms": "",
"pt": "",
"th": "",
"tl": "",
"vi": "",
"yo": "",
"zh_CN": "",
"zh_TW": ""
},
"prechat_form_first_field_enabled": true,
"prechat_form_second_field_enabled": false,
"prechat_form_inquiry_types_enabled": true,
"postchat_rating_comment_placeholder": {
"de": "",
"en": "",
"es": "",
"fr": "",
"ha": "",
"id": "",
"ig": "",
"it": "",
"ja": "",
"ms": "",
"pt": "",
"th": "",
"tl": "",
"vi": "",
"yo": "",
"zh_CN": "",
"zh_TW": ""
}
},
"webchat_allow_origins": [
"*"
],
"assign_conversation_to": "BOT",
"conversation_idle_action": "NOTIFY_AGENT",
"max_conversations_per_agent": 2,
"assign_conversation_to_ateam": null,
"time_to_accept_transfer_seconds": 120,
"conversation_timeout_time_minutes": 1,
"conversation_idleness_threshold_minutes": 5
}
}
_channel_profileContains the end user profile information from the channel such as user id on Proto, user profile display name, user from what type of channel, profile picture URL and additional info. (different additional information is stored in different channel type)
Additionally provides more for webchat, such as:
- Info from pre-chat form (if activated in webchat settings)
- Info about location/IP...and more.
{
"id":"060dab0c0d000020c69148673608b3f3",
"display_name":null,
"type":"platform:anon",
"profile_pic_url":null,
"info":{
"email":null,
"prechat_form_enabled":true,
"prechat_form":{
"email_or_username":"[email protected]",
"inquiry_types_enabled":true,
"inquiry_type":"I'm a guest",
"first_field_enabled":true,
"first_field_label":"Platform",
"first_field_value":"My dashboard",
"second_field_enabled":false,
"second_field_label":null,
"second_field_value":null
}
},
"ip":"210.186.90.62",
"location":{
"country":"Malaysia",
"region":"Johor",
"country_code":"MY",
"region_code":"01"
},
"user_agent":{
"platform":"windows",
"browser":"chrome",
"browser_version":"116.0.0.0"
}
}
_humanEnd user human profile (if the end user have a profile created on Human page and listed as Know user). Contains information about the user name, email, phone number and details set in Human page.{
"id": "abcdefghIjkL",
"company_id": "co_abcd1234",
"bot_id": "bot_abcd1234",
"fullname": "Hilary",
"email": "[email protected]",
"phone_number": "",
"profile_pic_id": "",
"created_at": "2022-07-29T14:15:55.862447+00:00",
"updated_at": "2022-07-29T14:15:55.862447+00:00",
"deleted_at": null,
"access_token": null,
"refresh_token": null,
"uid": "[email protected]",
"tags": null
}
defined_variable.attrCreate a Survey block and select the Respondent type. If the end user provide the correct Respondent, it return the Respondent Name and ID that you set in the Case Group in Track{
"id": "4c6939fa-6fad-4f6a-ab5b-da0854312345",
"name": "ABC Bank"
}
new_casereturn the case info if a case is successfully created from the Create Case block{
"bot_id": "bot_iCU07abcd",
"case_model": {
"company_id": "co_J7abcd",
"created_at": "2021-01-29T02:11:14.125674+00:00",
"created_by": "user_71M2lkvoabcd",
"disable_notify_institute": false,
"email_localpart_type": "CASEMODEL_ID",
"email_recipient": null,
"id": "casem_GMabcd",
"name": "Test",
"prefix": "",
"resolve_time_limit": 1
},
"casem_id": "casem_Gabcd",
"category": {
"depth": 0,
"id": "0269bd01-8c0e-429e-8eab-ab77b3073abcd",
"name": "General",
"parent_id": null
},
"category_id": "0269bd01-8c0e-429e-8eab-ab77b30abcd",
"closed_at": null,
"closed_by_user_id": null,
"closed_by_user_type": null,
"conversation_id": "05bad563bb000099b2a4e151cdeabcd",
"conversation_type": "ws:debug",
"created_at": "2022-10-19T07:23:57.598591+00:00",
"created_by": null,
"created_by_user_id": null,
"created_by_user_type": null,
"custom_attrs": {},
"custom_attrs_attachment_infos": [],
"description": "test",
"ext_ref": null,
"gateway_id": "testchat_bot_iCU07gqabcd",
"id": "case_zzg9ngbdwqt7uvjd62rdabcd",
"institute_frt_at": null,
"institute_id": "4c6939fa-6fad-4f6a-ab5b-da085433abcd",
"institute_name": "Maybank",
"notified_at": null,
"overdue_expected_at": "2022-10-19T08:23:57.598591+00:00",
"overdue_set_at": null,
"person_representative_relationship": null,
"primary_person": {
"casem_id": "casem_GMabcd",
"first_name": null,
"full_name": "Weiying",
"id": "05bad565-3500-003f-e02a-31d2abcd7",
"last_name": null,
"middle_name": null,
"primary_email": "",
"primary_phone": ""
},
"primary_person_id": "05bad565-3500-003f-e02a-31dabcd577",
"primary_representative": null,
"primary_representative_id": null,
"processor_id": null,
"received_at": "2022-10-19T07:23:57.598591+00:00",
"sender_id": "bot_iCU07gqMuT79",
"sender_type": "platform:bot",
"short_id": "5C84HADG36T",
"solved_at": null,
"solved_by_user_id": null,
"solved_by_user_type": null,
"status": 0,
"status_text": "NEW",
"title": "Test",
"updated_at": null,
"updated_by": null
}
_track.fetch_case_by_short_id("case_id_here")For getting the status (and other useful info) of a case via the case ID.
Eg. _track.fetch_case_by_short_id("BSPCAMS-23-5VLMXVFZ00G")
Returns a dictionary as below:

{"id": "case_tb0ddr4tiqx7z4qv7otoys90", "short_id": "BSPCAMS-23-5VLMXVFZXYZ", "status": 0, "status_verbose": "NEW", "respondent_name": "Maybank", "contact_name": "Weiying"}
_track.fetch_cases_by_email("email_here")For getting the status (and other useful info) of all cases associated with a specific email address, from every cases group within same company/workspace
Eg. _track.fetch_cases_by_email("test@test. com")
Returns an array:

[
{
"id":"case_tb0ddr4tiqx7z4qv7otoys90",
"short_id":"BSPCAMS-23-5VLMXVFZXYZ",
"status":0,
"status_verbose":"NEW",
"respondent_name":"Maybank",
"contact_name":"Weiying"
},
{
"id":"case_aol7E62KxndSyUU",
"short_id":"4G3R2RG5XYZ",
"status":4,
"status_verbose":"OVERDUE",
"respondent_name":null,
"contact_name":"Weiying"
},
{
"id":"case_iywo9YgmVKRIMAP",
"short_id":"5T7P2CA2XYZ",
"status":4,
"status_verbose":"OVERDUE",
"respondent_name":null,
"contact_name":"Weiying Kok"
}
]
_chatFor Bitrix24 channel that store bitrix24_chat_id, bitrix24_chat_entity_id, bitrix24_chat_entity_data_1 values{
"bitrix24_chat_id": 12345,
"bitrix24_chat_entity_id"" "viber|16|9kyvoQhcabdcsQyzniKU6Zw==|12345",
"bitrix24_chat_entity_data_1": "Y|DEAL|297920|N|N|1234567|1234567890|0|0|0"
}