Update the Details of an Intelligent Trigger Rule
Description
You can use this API to update the details of an intelligent trigger rule.
OAuth Scope:
triggerrules.UPDATE
Requested Payload:
- 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.
- app_id (Mandatory): ID of the website to which the rule is to be mapped.
- title (Mandatory): Name of the trigger rule
- event (Mandatory): Instant at which the trigger is to be set off
- action (Mandatory): The action to be executed when visitors matching the set criteria lands on your site.
- 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.
- 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.
- 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
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.
URL:
Copiedhttps://{zohosalesiq_server_uri}/api/v2/{screenname}/triggerrules/{id}
Example
Copiedhttps://salesiq.zoho.com/api/v2/zylkerinc/triggerrules/44000000000201
Payload
Copied{
"title": "Custom action",
"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": "performs_custom_action",
"values": [
"action_1"
]
},
"action": {
"type": "send_chat_invite",
"params": {
"sender_name": "Patricia",
"value": "Hi there"
},
"delay": "120"
}
}
Sample Response
Copied{
"url": "/api/v2/zylkerinc/triggerrules/44000000000201",
"object": "trigger_rule",
"data": {
"id": "44000000000201",
"title": "Custom action",
"creator": {
"id": "44000000000104"
},
"enabled": true,
"created_time": "1550639281810",
"modified_time": "1550639282210",
"position": "2",
"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": "performs_custom_action",
"values": [
"action_1"
]
},
"action": {
"type": "send_chat_invite",
"params": {
"sender_name": "Patricia",
"value": "Hi there"
},
"delay": "120"
},
"app": {
"name": "restapi",
"id": "34139000000002043"
},
"stats":{
"triggered_count": "10",
"replied_count": "4",
"failed_count": "3",
"seen_count": "7",
"last_triggered_time": "1550639281810"
}
}
}