Skip to main content

​Create an Intelligent Trigger Rule

Description

You can use this API to create an intelligent trigger rule.

OAuth Scope:

triggerrules.CREATE

Requested Payload:

  • app_id (Mandatory): ID of the website to which the rule is to be mapped.
  • and_criteria (Mandatory): To add an additional condition and criteria to the trigger rule. You can specify a group of OR_criteria within the AND_criteria.
  • or_criteria: Specifies a set of criteria containing the comparator, values, and field name ie., you can provide more than one criteria and the rule will execute if the visitor matches any of the given criteria. 
  • field_name: Fields that you set to filter the visitor who matches the rule.
  • sub_fields: The sub field that you set to filter the visitor who matches the rule.
  • comparator: The comparator strings for that specific rule you have set is used to match the values (eg: Contains, Equals to, etc.)
  • values: The values that you have defined for each field that the visitor should obtain to match the rule.
  • title: Name of the trigger rule
  • event: Instant at which the trigger is to be set off
  • type: Type of trigger to be used
  • sender_name: On behalf of whom the chat invite is to be sent
  • delay: Time frame after which the chat window is to be opened
  • integ_name : The name of the integration.

You can use the Field name, Comparator, and values to populate the criteria of the intelligent trigger rule. You can also find the data type of these keys in the criteria of the fields section.

Field NameComparatorValues
regionis_equal_to, not_equalssouth_america, north_america, canada, asia_pacific, united_kingdom, europe_middle_east_and_africa
triggered_actionis_equal_to, not_equalsopen_chat_window, animate_button, send_chat_invite, show_button, show_bubble, glow_button
refereris_equal_to, begins_with, ends_with, contains, not_equals, not_contains, matches, not_matches 
landing_page_url is_equal_to, begins_with, ends_with, contains, not_equals, not_contains, matches, not_matches 
campaign_sourceis_equal_to, begins_with, ends_with, contains, not_equals, not_contains, matches, not_matches 
campaign_termis_equal_to, begins_with, ends_with, contains, not_equals, not_contains, matches, not_matches 
campaign_mediumis_equal_to, begins_with, ends_with, contains, not_equals, not_contains, matches, not_matches 
campaign_contentis_equal_to, begins_with, ends_with, contains, not_equals, not_contains, matches, not_matches 
utm_campaign_nameis_equal_to, begins_with, ends_with, contains, not_equals, not_contains, matches, not_matches 
emailis_equal_to, begins_with, ends_with, contains, not_equals, not_contains, matches, not_matches 
number_of_pages_browsedis_equal_to, begins_with, ends_with, contains, not_equals, not_contains, matches, not_matches 
landing_page_titleis, is_not, begins_with, ends_with, contains, not_contains 
visitor_email_updatedon, after, before 
countryis_equal_to, not_equalsPapua New Guinea, Combodia, Paraguay, Kazakhstan, Solomon Islands, Bahamas, Montserrat, Mali, Marshall Islands, Guadeloupe, Panama, Argentina, Isle Of Man, Seychelles, Zambia, Belize, South Georgia And The South Sandwich islands, Bahrain, Congo, Namibia, Comoros, Faroe Islands, Finland, Netherlands Antilles, Georgia, Yemen, Puerto Rico, Eritrea, Viet Nam, Madagascar, Aruba, Sweden, Malawi, Andorra, Liechtenstein, Poland, Bulgaria, Jordan, Tunisia, Tuvalu, United Arab Emirates, Kenya, French Polynesia, Lebanon, Djibouti, Azerbaijan, Cuba, Czech Republic, Saint Lucia, Mauritania, Guernsey, Timor-leste, Mayotte, Israel, San Marino, Australia, Tajikistan, Myanmar, Cameroon, Gibraltar, Cyprus, Northern Mariana Islands, Malaysia, Iceland, Oman, Bosnia And Herzegovina, Armenia, Gabon, Luxembourg, Brazil, Algeria, Jersey, Slovenia, Ecuador, Colombia, Moldova, Lao People's Democratic Republic, Cocos (keeling) Islands, Vanuatu, United States Minor Outlying Islands, Honduras, Italy, Antarctica, Nauru, Guinea-bissau, Haiti, Afghanistan, Russian Federation, Burundi, Singapore, French Guiana, American Samoa, Netherlands, China, Martinique, The Democratic Republic Of Congo, Kyrgyzstan, Wallis And Futuna, Saint Pierre And Miquelon, Reunion, Bhutan, Romania, Togo, Philippines, Uzbekistan, Pitcairn, British Virgin Islands, Zimbabwe, British Indian Ocean Territory, Montenegro, Indonesia, Dominica, Benin, Angola, Sudan, Brunei Darussalam, Portugal, New Caledonia, North Korea, Grenada, Greece, Cayman Islands, Mongolia, Latvia, Iran, Morocco, Guatemala, Guyana, Iraq, Cote D'ivoire, Chile, Holy See (vatican City State), Nepal, Ukraine, Tanzania, Ghana, Saint Vincent And The Grenadines, Anguilla, India, Canada, Maldives, Turkey, Belgium, Taiwan, South Africa, Bermuda, Aland Islands, Jamaica, Peru, Turkmenistan, Germany, Fiji, Tokelau, Hong Kong, United States, Guinea, Somalia, Chad, Thailand, Equatorial Guinea, Kiribati, Costa Rica, Falkland Islands (malvinas), Kuwait, Nigeria, Croatia, Sao Tome And Principe, Syrian Arab Republic, Uruguay, Sri Lanka, Cook Islands, United Kingdom, Switzerland, Samoa, Palestine, Spain, Venezuela, Liberia, Burkina Faso, Swaziland, Palau, Turks And Caicos Islands, Estonia, Christmas island, Libyan Arab Jamahiriya, Niue, Svalbard And Jan Mayen, South Korea, Austria, Mozambique, El Salvador, Monaco, Guam, Central african republic, Lesotho, Tonga, Heard Island And Mcdonald Islands, Western Sahara, Hungary, Europe, Japan, Curacao, Belarus, Mauritius, Bouvet Island, Norfolk Island, Trinidad And Tobago, Albania, New Zealand, Senegal, Macedonia, Ethiopia, Egypt, Sierra Leone, Bolivia, Malta, Saudi Arabia, Cape Verde, Pakistan, Gambia, Qatar, Ireland, U.S. Virgin Islands, Slovakia, Lithuania, Serbia, France, Niger, Rwanda, Saint Kitts And Nevis, French Southern Territories, Bangladesh, Barbados, Nicaragua, Norway, Botswana, Macao, Dominican Republic, Denmark, Mexico, Uganda, Suriname, Micronesia, Saint Helena, Greenland, Antigua And Barbuda)
visitor_infois_equal_to, between, greater_than, begins_with, ends_with, contains, not_equals 
time_on_sitegreater_than, less_than, is_equal_to, not_equals, between 
actions_performedis, is_notcontacted, bot_transfer_missed, missed, clicked, chat_completed, triggered_replied, email_updated
visitor_typeis_equal_to, not_equalsall, new, returning
browseris_equal_to, not_equals

opera, google_chrome, apple_safari, mozilla_firefox, microsoft_internet_explorer,unknown

operating_systemis_equal_to, not_equalsnokia, apple_ipad, sun_solaris, microsoft_windows, web_os, nintendo,  apple_macintosh, apple_iphone, android, symbian, playstation,  blackberry, linux, motorola, kindle
search_engineis_equal_to, not_equalsteoma, inktomi, yahoo, webcrawler, baidu, google, bing
cityis_equal_to, not_equals 
stateis_equal_to, not_equals 
current_visit_sourceis_equal_to, not_equalsreferral, adwords, direct,  campaign, search_engine, social_media
first_visit_sourceis_equal_to, not_equals 
custom_actionis_equal_to, not_equals 
number_of_visitsis_equal_to, between, greater_than, less_than, not_equals 
number_of_past_chatsis_equal_to, between, greater_than, less_than, not_equals 
number_of_pages_accessedis_equal_to, between, greater_than, less_than, not_equals 
ip_addressis_equal_to, between 
previous_page_urlis, is_not, begins_with, ends_with, contains, not_contain 
current_page_urlis, is_not, begins_with, ends_with, contains, not_contains 
triggered_statusis_equal_to, not_equals 
current_page_titleis_equal_to, begins_with, ends_with, contains, not_equals, not_contains, matches, not_matches 
departmentis_equal_to, not_equals 
last_action_performedis_equal_to, not_equals 
visitor_availabilityis_equal_to, not_equals 
leadscore

is_equal_to, between, greater_than, less_than, not_equals

 

URL:

Copiedhttps://{zohosalesiq_server_uri}/api/v2/{screenname}/triggerrules

Example

Copiedhttps://salesiq.zoho.com/api/v2/zylkerinc/triggerrules

Payload

Copied{
  "app_id": "44000000000047",
  "title": "Chat invite",
  "and_criteria": [
    {
      "or_criteria": [
        {
          "comparator": "is_equal_to",
          "values": [
            "Japan"
          ],
          "field_name": "country"
        },
{
              "comparator": "is_equal_to",
              "sub_field": "No of Open Deals",
              "values": [
                  "12"
              ],
              "field_name": "crm_deal",
              "integ_name": "zohocrm"
          }
      ]
    }
  ],
  "event": {
    "type": "lands_on_website"
  },
  "action": {
    "type": "send_chat_invite",
    "params": {
      "sender_name": "Patricia",
      "value": "Hi there"
    },
    "delay": "120"
  }
}

Success Response

Copied{
  "url": "/api/v2/zylkerinc/triggerrules",
  "object": "trigger_rule",
  "data": {
    "id": "44000000000201",
     "app": {
            "name": "restapi",
            "id": "34139000000002043"
      },
     "stats": 
    {
    "last_triggered_time": "-1",
    "failed_count": "0",
    "seen_count": "0",
    "replied_count": "0",
    "triggered_count": "0"
     },
    "title": "Chat invite",
    "creator": {
      "id": "44000000000104"
    },
    "enabled": true,
    "created_time": "1550639281810",
    "modified_time": "1550639282210",
    "position": "1",
    "and_criteria": [
      {
        "or_criteria": [
          {
            "comparator": "is_equal_to",
            "values": [
              "Japan"
            ],
            "field_name": "country"
          },
{
              "comparator": "is_equal_to",
              "sub_field": "No of Open Deals",
              "values": [
                  "12"
              ],
              "field_name": "crm_deal",
              "integ_name": "zohocrm"
          }
        ]
      }
    ],
    "event": {
      "type": "lands_on_website"
    },
    "action": {
      "type": "send_chat_invite",
      "params": {
        "sender_name": "Patrcia",
        "value": "hi da"
      },
      "delay": "120"
    }
  }
}