Chatbot Smart Trigger

Chatbot Smart Triggers
- Chatbot Smart Triggers Manage
GET bot/chatbots/{id}/chatbotSmartTriggers
GET bot/chatbotSmartTriggers/{id}
POST bot/chatbotSmartTriggers
PUT bot/chatbotSmartTriggers/{id}
DELETE bot/chatbotSmartTriggers/{id}
Model
Chatbot Smart Trigger JSON Format

Chatbot Smart Trigger is represented as simple flat JSON objects with the following keys:

Name Type Description
id guid Id of the smart trigger.
chatbotId guid Id of the chatbot.
name string Name of smart trigger.
isEnabled bool Whether an action is enabled or not.
conditionExpressionType string Allowed values are "any", "all", "logicalExpression".
logicalExpression string It is an expression that users one or more conditions, example: (1 or 2) and 3.
order integer Must be greater than or equal to 0, ascending order.
chatbotSmartTriggerConditions chatbotSmartTriggerConditions[] Reference to Chatbot Smart Trigger Condition.
chatbotSmartTriggerActions chatbotSmartTriggerActions[] Reference to Chatbot Smart Trigger Action.

Chatbot Smart Trigger Action JSON Format:

Name Type Description
id guid Id of the smart trigger action.
smartTriggerId guid Id of the smart trigger.
type string Allowed values are "sendNotification", "autoMonitor", "transferChat", "changeAssignee", "addToSegment".
isEnabled bool If an action is enabled.
agentOfflineMessage string Agent offlineMessage prompt message.
targetType string Allowed values are "agent", "department", "segment".
segmentId guid Segment Id of the visitor.
segment segment Reference to Segment.
agents agents[] Reference to Agent.
departments departments[] Reference to Department.
agentIds array The list of the action identifiers of chatbot smart trigger, which the agent is related to.
departmentIds array The list of the action identifiers of chatbot smart trigger, which the department is related to.

Chatbot Smart Trigger Condition JSON Format:

Name Type Description
id guid Id of the smart trigger condition.
smartTriggerId guid Id of the smart trigger.
fieldName string FieldName of the condition.
operator string Allowed values are "is", "isNot", "contains", "notContains", "regularExpression", "isLessThan", "isMoreThan", "isOneOf", "isNotIn".
value string A string of condition matching value.
order integer The order of the condition, must be greater than or equal to 0, ascending order.
Endpoint
Get the list of Chatbot Smart Triggers

GET bot/chatbots/{id}/chatbotSmartTriggers

Parameters:
Name Type In Required Description
chatbotId guid query yes Id of the chatbot.
include string query no Allowed values are "chatbotSmartTriggerCondition", "chatbotSmartTriggerAction".
Response:

An array of   Chatbot Smart Trigger

Example

Sample Request:

curl https://api15.comm100.io/v4/bot/chatbots/55c51763-8241-40a7-bb61-95231a03bb86/chatbotSmartTriggers \
-X 'GET' \
-H 'Authorization: Bearer {access_token}' \

Response:

 HTTP/1.1 200 OK

{"chatbotSmartTriggers":[{"id":"55c51763-8241-40a7-bb61-95231a03bb86","chatbotId":"55c51763-8241-40a7-bb61-96231a03bb86","name":"Testtrigger","isEnabled":false,"conditionExpressionType":"all","logicalExpression":"(1 or 2) and 3","order":1,"chatbotSmartTriggerConditions":[{"id":"693c1ffa-4d57-40d2-9fc0-68e89430b4f1","smartTriggerId":"0DB25329-7C46-EB11-8100-00155D081D0B","fieldName":"intent","operator":"is","value":"test","order":0}],"chatbotSmartTriggerActions":[{"id":"d6bd7d9a-536e-43e4-a030-7b9f36b6ab4f","smartTriggerId":"0DB25329-7C46-EB11-8100-00155D081D0B","type":"addToSegment","isEnabled":true,"agentOfflineMessage":"No one on the Sales team is currently online.","targetType":"department.","segmentId":"18B25329-7C46-EB11-8100-00155D081D0B","segment":{"alertToType":"none","conditionMetType":"all","logicalExpression":"","id":"b797848b-0e86-41ac-b048-d72bd0f075ed","name":"Segment One","isEnabled":false,"description":"This is Segment One","color":"#339FD9","order":2,"segmentConditions":[{"id":"76ec9bdb-854a-4536-8d5b-451b75b908b9","segmentId":"51b60908-28db-427f-aebc-b3afa145f051","fieldName":"{!Visitor.Number of visits}","operator":"is","value":"3","order":0,"description":"Segment - Number of visits"}],"agentIds":["4BA2EF45-7D46-EB11-8100-00155D081D0B"],"departmentIds":["6fd98c99-f183-4247-bdda-47491426e577"]},"agents":[{"id":"64bb87e4-6940-4d2c-a6e4-176d52b8e9b8","email":"andy@comm100.com","displayName":"Andy Liao","firstName":"Andy","lastName":"Liao","isAdmin":true,"isActive":true,"phone":"13712345678","title":"Manager","bio":"Hello, I am Andy","timeZone":"Pacific Standard Time","datetimeFormat":"YYYY/MM/DD HH:mm:ss","createdTime":"2020-12-25T06:01:00.913Z","isLocked":true,"lockedTime":"2020-12-25T06:01:00.93Z","ifCustomizeAvatar":true,"customizeAvatar":"https://dash11.comm100dev.io/Global/agents/c1ad60f8-e2e1-47d2-ad50-8b5de24d2b06/customizeAvatar?SiteId=10000&version=6e7b513d20baaf89b84e81e56d365111","systemAvatarId":"1383d4fd-3114-eb11-80fc-00155d081d0b","avatar":"https://api15.comm100.io/v4/Global/agents/64bb87e4-6940-4d2c-a6e4-176d52b8e9b8/avatar","permissionIds":["45A2EF45-7D46-EB11-8100-00155D081D0B"],"departmentIds":["b6ff11d8-0be7-4e99-b8c7-5a7ab501c69b"],"roleIds":["e0bf1302-d145-eb11-8100-00155d081d0b"]}],"departments":[{"id":"a46afdad-82c9-4405-bb4b-8d5517ef57d8","name":"markting","description":"markting departments","isAvailableInLiveChat":true,"isAvailableInTicketingAndMessaging":true,"offlineMessageMailTo":"toAllAgents","offlineMessageEmailAddresses":"andy@comm100.com","agentIds":["3CA2EF45-7D46-EB11-8100-00155D081D0B"]}],"agentIds":["48A2EF45-7D46-EB11-8100-00155D081D0B"],"departmentIds":["6fd98c99-f183-4247-bdda-47491426e577"]}]}],"nextPage":null,"previousPage":null,"total":1}
Get a single Chatbot Smart Trigger

GET bot/chatbotSmartTriggers/{id}

Parameters:
Name Type In Required Description
include string query no Allowed values are "chatbotSmartTriggerCondition", "chatbotSmartTriggerAction".
Response:
Example

Sample Request:

curl https://api15.comm100.io/v4/bot/chatbotSmartTriggers/55c51763-8241-40a7-bb61-95231a03bb86 \
-X 'GET' \
-H 'Authorization: Bearer {access_token}' \

Response:

 HTTP/1.1 200 OK

{"id":"55c51763-8241-40a7-bb61-95231a03bb86","chatbotId":"55c51763-8241-40a7-bb61-96231a03bb86","name":"Testtrigger","isEnabled":false,"conditionExpressionType":"all","logicalExpression":"(1 or 2) and 3","order":1,"chatbotSmartTriggerConditions":[{"id":"693c1ffa-4d57-40d2-9fc0-68e89430b4f1","smartTriggerId":"0DB25329-7C46-EB11-8100-00155D081D0B","fieldName":"intent","operator":"is","value":"test","order":0}],"chatbotSmartTriggerActions":[{"id":"d6bd7d9a-536e-43e4-a030-7b9f36b6ab4f","smartTriggerId":"0DB25329-7C46-EB11-8100-00155D081D0B","type":"addToSegment","isEnabled":true,"agentOfflineMessage":"No one on the Sales team is currently online.","targetType":"department.","segmentId":"18B25329-7C46-EB11-8100-00155D081D0B","segment":{"alertToType":"none","conditionMetType":"all","logicalExpression":"","id":"b797848b-0e86-41ac-b048-d72bd0f075ed","name":"Segment One","isEnabled":false,"description":"This is Segment One","color":"#339FD9","order":2,"segmentConditions":[{"id":"76ec9bdb-854a-4536-8d5b-451b75b908b9","segmentId":"51b60908-28db-427f-aebc-b3afa145f051","fieldName":"{!Visitor.Number of visits}","operator":"is","value":"3","order":0,"description":"Segment - Number of visits"}],"agentIds":["4BA2EF45-7D46-EB11-8100-00155D081D0B"],"departmentIds":["6fd98c99-f183-4247-bdda-47491426e577"]},"agents":[{"id":"64bb87e4-6940-4d2c-a6e4-176d52b8e9b8","email":"andy@comm100.com","displayName":"Andy Liao","firstName":"Andy","lastName":"Liao","isAdmin":true,"isActive":true,"phone":"13712345678","title":"Manager","bio":"Hello, I am Andy","timeZone":"Pacific Standard Time","datetimeFormat":"YYYY/MM/DD HH:mm:ss","createdTime":"2020-12-25T06:01:00.913Z","isLocked":true,"lockedTime":"2020-12-25T06:01:00.93Z","ifCustomizeAvatar":true,"customizeAvatar":"https://dash11.comm100dev.io/Global/agents/c1ad60f8-e2e1-47d2-ad50-8b5de24d2b06/customizeAvatar?SiteId=10000&version=6e7b513d20baaf89b84e81e56d365111","systemAvatarId":"1383d4fd-3114-eb11-80fc-00155d081d0b","avatar":"https://api15.comm100.io/v4/Global/agents/64bb87e4-6940-4d2c-a6e4-176d52b8e9b8/avatar","permissionIds":["45A2EF45-7D46-EB11-8100-00155D081D0B"],"departmentIds":["b6ff11d8-0be7-4e99-b8c7-5a7ab501c69b"],"roleIds":["e0bf1302-d145-eb11-8100-00155d081d0b"]}],"departments":[{"id":"a46afdad-82c9-4405-bb4b-8d5517ef57d8","name":"markting","description":"markting departments","isAvailableInLiveChat":true,"isAvailableInTicketingAndMessaging":true,"offlineMessageMailTo":"toAllAgents","offlineMessageEmailAddresses":"andy@comm100.com","agentIds":["3CA2EF45-7D46-EB11-8100-00155D081D0B"]}],"agentIds":["48A2EF45-7D46-EB11-8100-00155D081D0B"],"departmentIds":["6fd98c99-f183-4247-bdda-47491426e577"]}]}
Create a new Chatbot Smart Trigger

POST bot/chatbotSmartTriggers

Parameters:
Name Type In Required Description
chatbotId guid body yes Id of the chatbot.
name string body yes Name of smart trigger.
isEnabled bool body yes Whether an action is enabled or not.
conditionExpressionType string body yes Allowed values are "any", "all", "logicalExpression".
logicalExpression string body no It is an expression that users one or more conditions, example: (1 or 2) and 3.
order integer body no Must be greater than or equal to 0, ascending order.
chatbotSmartTriggerActions chatbotSmartTriggerActions[] body yes Reference to Chatbot Smart Trigger Action.
chatbotSmartTriggerConditions chatbotSmartTriggerConditions[] body yes Reference to Chatbot Smart Trigger Condition.
Response:
Example

Sample Request:

curl https://api15.comm100.io/v4/bot/chatbotSmartTriggers \
-X 'POST' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-D '{"chatbotId":"55c51763-8241-40a7-bb61-96231a03bb86","name":"Testtrigger","isEnabled":false,"conditionExpressionType":"all","logicalExpression":"(1 or 2) and 3","order":1,"chatbotSmartTriggerActions":[{"type":"addToSegment","isEnabled":true,"agentOfflineMessage":"No one on the Sales team is currently online.","targetType":"department.","segmentId":"18B25329-7C46-EB11-8100-00155D081D0B"}],"chatbotSmartTriggerConditions":[{"fieldName":"intent","operator":"is","value":"test","order":0}]}'

Response:

 HTTP/1.1 201 Created

{"id":"55c51763-8241-40a7-bb61-95231a03bb86","chatbotId":"55c51763-8241-40a7-bb61-96231a03bb86","name":"Testtrigger","isEnabled":false,"conditionExpressionType":"all","logicalExpression":"(1 or 2) and 3","order":1,"chatbotSmartTriggerConditions":[{"id":"693c1ffa-4d57-40d2-9fc0-68e89430b4f1","smartTriggerId":"0DB25329-7C46-EB11-8100-00155D081D0B","fieldName":"intent","operator":"is","value":"test","order":0}],"chatbotSmartTriggerActions":[{"id":"d6bd7d9a-536e-43e4-a030-7b9f36b6ab4f","smartTriggerId":"0DB25329-7C46-EB11-8100-00155D081D0B","type":"addToSegment","isEnabled":true,"agentOfflineMessage":"No one on the Sales team is currently online.","targetType":"department.","segmentId":"18B25329-7C46-EB11-8100-00155D081D0B","segment":{"alertToType":"none","conditionMetType":"all","logicalExpression":"","id":"b797848b-0e86-41ac-b048-d72bd0f075ed","name":"Segment One","isEnabled":false,"description":"This is Segment One","color":"#339FD9","order":2,"segmentConditions":[{"id":"76ec9bdb-854a-4536-8d5b-451b75b908b9","segmentId":"51b60908-28db-427f-aebc-b3afa145f051","fieldName":"{!Visitor.Number of visits}","operator":"is","value":"3","order":0,"description":"Segment - Number of visits"}],"agentIds":["4BA2EF45-7D46-EB11-8100-00155D081D0B"],"departmentIds":["6fd98c99-f183-4247-bdda-47491426e577"]},"agents":[{"id":"64bb87e4-6940-4d2c-a6e4-176d52b8e9b8","email":"andy@comm100.com","displayName":"Andy Liao","firstName":"Andy","lastName":"Liao","isAdmin":true,"isActive":true,"phone":"13712345678","title":"Manager","bio":"Hello, I am Andy","timeZone":"Pacific Standard Time","datetimeFormat":"YYYY/MM/DD HH:mm:ss","createdTime":"2020-12-25T06:01:00.913Z","isLocked":true,"lockedTime":"2020-12-25T06:01:00.93Z","ifCustomizeAvatar":true,"customizeAvatar":"https://dash11.comm100dev.io/Global/agents/c1ad60f8-e2e1-47d2-ad50-8b5de24d2b06/customizeAvatar?SiteId=10000&version=6e7b513d20baaf89b84e81e56d365111","systemAvatarId":"1383d4fd-3114-eb11-80fc-00155d081d0b","avatar":"https://api15.comm100.io/v4/Global/agents/64bb87e4-6940-4d2c-a6e4-176d52b8e9b8/avatar","permissionIds":["45A2EF45-7D46-EB11-8100-00155D081D0B"],"departmentIds":["b6ff11d8-0be7-4e99-b8c7-5a7ab501c69b"],"roleIds":["e0bf1302-d145-eb11-8100-00155d081d0b"]}],"departments":[{"id":"a46afdad-82c9-4405-bb4b-8d5517ef57d8","name":"markting","description":"markting departments","isAvailableInLiveChat":true,"isAvailableInTicketingAndMessaging":true,"offlineMessageMailTo":"toAllAgents","offlineMessageEmailAddresses":"andy@comm100.com","agentIds":["3CA2EF45-7D46-EB11-8100-00155D081D0B"]}],"agentIds":["48A2EF45-7D46-EB11-8100-00155D081D0B"],"departmentIds":["6fd98c99-f183-4247-bdda-47491426e577"]}]}
Update the Chatbot Smart Trigger

PUT bot/chatbotSmartTriggers/{id}

Parameters:
Name Type In Required Description
chatbotId guid body yes Id of the chatbot.
name string body yes Name of smart trigger.
isEnabled bool body yes Whether an action is enabled or not.
conditionExpressionType string body yes Allowed values are "any", "all", "logicalExpression".
logicalExpression string body no It is an expression that users one or more conditions, example: (1 or 2) and 3.
order integer body no Must be greater than or equal to 0, ascending order.
chatbotSmartTriggerActions chatbotSmartTriggerActions[] body yes Reference to Chatbot Smart Trigger Action.
chatbotSmartTriggerConditions chatbotSmartTriggerConditions[] body yes Reference to Chatbot Smart Trigger Condition.
Response:
Example

Sample Request:

curl https://api15.comm100.io/v4/bot/chatbotSmartTriggers/55c51763-8241-40a7-bb61-95231a03bb86 \
-X 'PUT' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-D '{"chatbotId":"55c51763-8241-40a7-bb61-96231a03bb86","name":"Testtrigger","isEnabled":false,"conditionExpressionType":"all","logicalExpression":"(1 or 2) and 3","order":1,"chatbotSmartTriggerActions":[{"type":"addToSegment","isEnabled":true,"agentOfflineMessage":"No one on the Sales team is currently online.","targetType":"department.","segmentId":"18B25329-7C46-EB11-8100-00155D081D0B"}],"chatbotSmartTriggerConditions":[{"fieldName":"intent","operator":"is","value":"test","order":0}]}'

Response:

 HTTP/1.1 200 OK

{"id":"55c51763-8241-40a7-bb61-95231a03bb86","chatbotId":"55c51763-8241-40a7-bb61-96231a03bb86","name":"Testtrigger","isEnabled":false,"conditionExpressionType":"all","logicalExpression":"(1 or 2) and 3","order":1,"chatbotSmartTriggerConditions":[{"id":"693c1ffa-4d57-40d2-9fc0-68e89430b4f1","smartTriggerId":"0DB25329-7C46-EB11-8100-00155D081D0B","fieldName":"intent","operator":"is","value":"test","order":0}],"chatbotSmartTriggerActions":[{"id":"d6bd7d9a-536e-43e4-a030-7b9f36b6ab4f","smartTriggerId":"0DB25329-7C46-EB11-8100-00155D081D0B","type":"addToSegment","isEnabled":true,"agentOfflineMessage":"No one on the Sales team is currently online.","targetType":"department.","segmentId":"18B25329-7C46-EB11-8100-00155D081D0B","segment":{"alertToType":"none","conditionMetType":"all","logicalExpression":"","id":"b797848b-0e86-41ac-b048-d72bd0f075ed","name":"Segment One","isEnabled":false,"description":"This is Segment One","color":"#339FD9","order":2,"segmentConditions":[{"id":"76ec9bdb-854a-4536-8d5b-451b75b908b9","segmentId":"51b60908-28db-427f-aebc-b3afa145f051","fieldName":"{!Visitor.Number of visits}","operator":"is","value":"3","order":0,"description":"Segment - Number of visits"}],"agentIds":["4BA2EF45-7D46-EB11-8100-00155D081D0B"],"departmentIds":["6fd98c99-f183-4247-bdda-47491426e577"]},"agents":[{"id":"64bb87e4-6940-4d2c-a6e4-176d52b8e9b8","email":"andy@comm100.com","displayName":"Andy Liao","firstName":"Andy","lastName":"Liao","isAdmin":true,"isActive":true,"phone":"13712345678","title":"Manager","bio":"Hello, I am Andy","timeZone":"Pacific Standard Time","datetimeFormat":"YYYY/MM/DD HH:mm:ss","createdTime":"2020-12-25T06:01:00.913Z","isLocked":true,"lockedTime":"2020-12-25T06:01:00.93Z","ifCustomizeAvatar":true,"customizeAvatar":"https://dash11.comm100dev.io/Global/agents/c1ad60f8-e2e1-47d2-ad50-8b5de24d2b06/customizeAvatar?SiteId=10000&version=6e7b513d20baaf89b84e81e56d365111","systemAvatarId":"1383d4fd-3114-eb11-80fc-00155d081d0b","avatar":"https://api15.comm100.io/v4/Global/agents/64bb87e4-6940-4d2c-a6e4-176d52b8e9b8/avatar","permissionIds":["45A2EF45-7D46-EB11-8100-00155D081D0B"],"departmentIds":["b6ff11d8-0be7-4e99-b8c7-5a7ab501c69b"],"roleIds":["e0bf1302-d145-eb11-8100-00155d081d0b"]}],"departments":[{"id":"a46afdad-82c9-4405-bb4b-8d5517ef57d8","name":"markting","description":"markting departments","isAvailableInLiveChat":true,"isAvailableInTicketingAndMessaging":true,"offlineMessageMailTo":"toAllAgents","offlineMessageEmailAddresses":"andy@comm100.com","agentIds":["3CA2EF45-7D46-EB11-8100-00155D081D0B"]}],"agentIds":["48A2EF45-7D46-EB11-8100-00155D081D0B"],"departmentIds":["6fd98c99-f183-4247-bdda-47491426e577"]}]}
Remove the Chatbot Smart Trigger

DELETE bot/chatbotSmartTriggers/{id}

Parameters:
No Parameters
Response:

No Content

Example

Sample Request:

curl https://api15.comm100.io/v4/bot/chatbotSmartTriggers/55c51763-8241-40a7-bb61-95231a03bb86 \
-X 'DELETE' \
-H 'Authorization: Bearer {access_token}' \

Response:

 HTTP/1.1 204 No Content