Add a Chat Routing Rule
Description
You can use this API to add a chat routing rule.
Requested Payload:
- and_criteria (Mandatory): To add an additional condition and criteria to the chat 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 : To embed the id of the website.
- routing_type : The type of routing rule you have set to route your website visitors chat.
- id: Unique Id that specifies the chat routing rule.
OAuth Scope:
SalesIQ.chatroutingrules.CREATE
You can use the Field name, Comparator and values to populate the criteria of the chat 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}/chatroutingrules
Example
Copiedhttps://salesiq.zoho.com/api/v2/zylker/chatroutingrules
Payload:
Copied{
"app_id": "44000000000047",
"title": "zylker-campaigns",
"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"
}
]
}
],
"routing_type": "route_to_selected_users",
"userset": [
{
"department_ids": [
"44000000020001"
]
},
{
"operator_ids": [
"44000000018001"
]
}
]
}
Sample Response:
Copied{
"url": "/web/v2/zylker/chatroutingrules/44000000030007",
"object": "chat_routing_rule",
"data": {
"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"
}
]
}
],
"modified_time": 1547142365883,
"id": "44000000030007",
"app": {
"name": "restapi",
"id": "34139000000002043"
},
"stats":
{
"missed_count": 0,
"connected_count": 0,
"last_routed_time": -1,
"requested_count": 0,
"transfered_count": 0
},
"condition": "at_least_one_user_online",
"creator": {
"id": "44000000000005"
},
"ennabled": true,
"position": 57,
"title": "jegan_raj",
"created_time": 1547142365883,
"routing_type": "route_to_selected_users",
"userset": [
{
"department_ids": [
"44000000020001"
]
},
{
"operator_ids": [
"44000000018001"
]
}
],
}
}