Add a Visitor Routing Rule
Description
You can use this API to add a visitor routing rule.
Requested Payload:
- and_criteria (Mandatory): To add an additional condition and criteria to the visitor routing 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 fieldname 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.
- integ_name : The name of the integration.
- userset : To notify the list of users who matches the rule to a specific operator.
- department_ids : To list the department IDs
- operator_ids : To list the operator IDs
- dynamic_users : To specify the details of the user ( whether the user is a CRM attender / Last available attender / All available users.)
- app_id (Mandatory) : To embed the id of the website.
- routing_type : The type of routing rule you have set to route your website visitors.
- id: Unique Id that specifies the visitor routing rule.
OAuth Scope:
SalesIQ.visitorroutingrules.CREATE
You can use the Field name, Comparator and values to populate the criteria of the visitor routing rule. You can also find the data type of these keys in the criteria of the fields section.
URL:
Copiedhttps://{[zohosalesiq_server_uri](https://www.zoho.com/salesiq/help/developer-section/rest-api-v2.html)}/api/v2/{screenname}/visitorroutingrule
Example
Copiedhttps://salesiq.zoho.com/api/v2/zylker/visitorroutingrules
Payload:
Copied{
"app_id": "44000000000047",
"title": "first",
"and_criteria": [
{
"or_criteria": [
{
"field_name": "browser",
"values": [
"google_chrome"
],
"comparator": "is_equal_to"
},
{
"field_name": "campaign_medium",
"values": [
"orset 1"
],
"comparator": "contains"
},
{
"comparator": "is_equal_to",
"sub_field": "No of Open Deals",
"values": [
"12"
],
"field_name": "crm_deal",
"integ_name": "zohocrm"
}
]
}
],
"routing_type": "route_to_selected_users",
"userset": [
{
"operator_ids": [
"44000000018001"
],
"department_ids": [ 0003445678345 ],
"dynamic_users": [ last_attender ]
}
]
}
Sample Response:
Copied{
"url": "/api/v2/revamp07/visitorroutingrules",
"object": "visitor_routing_rules",
"data": {
"modified_time": 1546845430168,
"id": 44000000014017,
"stats": {
"routed_count": "5",
"replied_count": "4",
"last_routed_time": "1546846597340",
"triggered_count": "1"
},
"app": {
"name": "restapi",
"id": "34139000000002043"
},
"enabled": true,
"position": 29,
"creator": {
"id": 44000000000005
},
"title": "Zylker-campaigns",
"created_time": 1546688046412,
"and_criteria": [
{
"or_criteria": [
{
"field_name": "browser",
"values": [
"google_chrome"
],
"comparator": "is_equal_to"
},
{
"field_name": "campaign_medium",
"values": [
"orset 1"
],
"comparator": "contains"
},
{
"comparator": "is_equal_to",
"sub_field": "No of Open Deals",
"values": [
"12"
],
"field_name": "crm_deal",
"integ_name": "zohocrm"
}
]
}
],
"routing_type": "route_to_selected_users",
"userset": [
{
"operator_ids": [
"44000000018001"
],
"department_ids": [],
"dynamic_users": []
}
],
"condition": "at_least_one_user_online"
}
}