Bot_ChatbotSmartTrigger

Bot_chatbotSmartTrigger_ChatbotSmartTriggers
- Bot_chatbotSmartTrigger_ChatbotSmartTriggers Manage
GET bot/chatbots/{id}/chatbotSmartTriggers
GET bot/chatbotSmartTriggers/{id}
POST bot/chatbotSmartTriggers
PUT bot/chatbotSmartTriggers/{id}
DELETE bot/chatbotSmartTriggers/{id}
Model
Bot_ChatbotSmartTrigger JSON Format

Bot_ChatbotSmartTrigger 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", "transferZendeskChat".
isEnabled bool If an action is enabled.
agentOfflineMessage string Agent offlineMessage prompt message.
targetType string Allowed values are "agent", "department", "segment", "zendeskDepartment".
segmentId guid Segment Id of the visitor.
segment segment Reference to LiveChat_Segment.
agents agents[] Reference to Agent.
departments departments[] Reference to LiveChat_Department.
departmentIds array The list of the action identifiers of chatbot smart trigger, which the department is related to.
agentIds array The list of the action identifiers of chatbot smart trigger, which the agent 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", "isEmpty", "isAfter", "isBefore", "isNotEmpty".
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 Bot_chatbotSmartTrigger_ChatbotSmartTriggers

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   Bot_ChatbotSmartTrigger

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":"e0ee1ec4-23ad-40b3-b1c6-59a1b86e9a95","smartTriggerId":"0DB25329-7C46-EB11-8100-00155D081D0B","fieldName":"intent","operator":"is","value":"test","order":0}],"chatbotSmartTriggerActions":[{"id":"27c9dfb1-05d8-482f-8151-4d809d651d2c","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"}],"departmentIds":["6fd98c99-f183-4247-bdda-47491426e577"],"agentIds":["4BA2EF45-7D46-EB11-8100-00155D081D0B"]},"agents":[{"id":"a9db5819-7f7e-49dd-9b1b-45378bfa47c1","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","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/a9db5819-7f7e-49dd-9b1b-45378bfa47c1/avatar","permissionIds":["45A2EF45-7D46-EB11-8100-00155D081D0B"],"departmentIds":["b6ff11d8-0be7-4e99-b8c7-5a7ab501c69b"],"roleIds":["e0bf1302-d145-eb11-8100-00155d081d0b"],"skillIds":["8F8D3782-B4FD-48C4-BA6B-82F0B7B53D7F"]}],"departments":[{"id":"accbe492-8bf1-42a3-abaa-8bd221175c0e","name":"markting","description":"markting departments","isAvailableInLiveChat":true,"isAvailableInTicketingAndMessaging":true,"offlineMessageMailTo":"toAllAgents","offlineMessageEmailAddresses":"andy@comm100.com","isAvailableInVoice":true,"agentIds":["3CA2EF45-7D46-EB11-8100-00155D081D0B"]}],"departmentIds":["6fd98c99-f183-4247-bdda-47491426e577"],"agentIds":["48A2EF45-7D46-EB11-8100-00155D081D0B"]}]}],"nextPage":null,"previousPage":null,"total":1}
Get a single Bot_ChatbotSmartTrigger

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":"e0ee1ec4-23ad-40b3-b1c6-59a1b86e9a95","smartTriggerId":"0DB25329-7C46-EB11-8100-00155D081D0B","fieldName":"intent","operator":"is","value":"test","order":0}],"chatbotSmartTriggerActions":[{"id":"27c9dfb1-05d8-482f-8151-4d809d651d2c","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"}],"departmentIds":["6fd98c99-f183-4247-bdda-47491426e577"],"agentIds":["4BA2EF45-7D46-EB11-8100-00155D081D0B"]},"agents":[{"id":"a9db5819-7f7e-49dd-9b1b-45378bfa47c1","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","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/a9db5819-7f7e-49dd-9b1b-45378bfa47c1/avatar","permissionIds":["45A2EF45-7D46-EB11-8100-00155D081D0B"],"departmentIds":["b6ff11d8-0be7-4e99-b8c7-5a7ab501c69b"],"roleIds":["e0bf1302-d145-eb11-8100-00155d081d0b"],"skillIds":["8F8D3782-B4FD-48C4-BA6B-82F0B7B53D7F"]}],"departments":[{"id":"accbe492-8bf1-42a3-abaa-8bd221175c0e","name":"markting","description":"markting departments","isAvailableInLiveChat":true,"isAvailableInTicketingAndMessaging":true,"offlineMessageMailTo":"toAllAgents","offlineMessageEmailAddresses":"andy@comm100.com","isAvailableInVoice":true,"agentIds":["3CA2EF45-7D46-EB11-8100-00155D081D0B"]}],"departmentIds":["6fd98c99-f183-4247-bdda-47491426e577"],"agentIds":["48A2EF45-7D46-EB11-8100-00155D081D0B"]}]}
Create a new Bot_ChatbotSmartTrigger

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":"e0ee1ec4-23ad-40b3-b1c6-59a1b86e9a95","smartTriggerId":"0DB25329-7C46-EB11-8100-00155D081D0B","fieldName":"intent","operator":"is","value":"test","order":0}],"chatbotSmartTriggerActions":[{"id":"27c9dfb1-05d8-482f-8151-4d809d651d2c","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"}],"departmentIds":["6fd98c99-f183-4247-bdda-47491426e577"],"agentIds":["4BA2EF45-7D46-EB11-8100-00155D081D0B"]},"agents":[{"id":"a9db5819-7f7e-49dd-9b1b-45378bfa47c1","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","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/a9db5819-7f7e-49dd-9b1b-45378bfa47c1/avatar","permissionIds":["45A2EF45-7D46-EB11-8100-00155D081D0B"],"departmentIds":["b6ff11d8-0be7-4e99-b8c7-5a7ab501c69b"],"roleIds":["e0bf1302-d145-eb11-8100-00155d081d0b"],"skillIds":["8F8D3782-B4FD-48C4-BA6B-82F0B7B53D7F"]}],"departments":[{"id":"accbe492-8bf1-42a3-abaa-8bd221175c0e","name":"markting","description":"markting departments","isAvailableInLiveChat":true,"isAvailableInTicketingAndMessaging":true,"offlineMessageMailTo":"toAllAgents","offlineMessageEmailAddresses":"andy@comm100.com","isAvailableInVoice":true,"agentIds":["3CA2EF45-7D46-EB11-8100-00155D081D0B"]}],"departmentIds":["6fd98c99-f183-4247-bdda-47491426e577"],"agentIds":["48A2EF45-7D46-EB11-8100-00155D081D0B"]}]}
Update the Bot_ChatbotSmartTrigger

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":"e0ee1ec4-23ad-40b3-b1c6-59a1b86e9a95","smartTriggerId":"0DB25329-7C46-EB11-8100-00155D081D0B","fieldName":"intent","operator":"is","value":"test","order":0}],"chatbotSmartTriggerActions":[{"id":"27c9dfb1-05d8-482f-8151-4d809d651d2c","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"}],"departmentIds":["6fd98c99-f183-4247-bdda-47491426e577"],"agentIds":["4BA2EF45-7D46-EB11-8100-00155D081D0B"]},"agents":[{"id":"a9db5819-7f7e-49dd-9b1b-45378bfa47c1","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","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/a9db5819-7f7e-49dd-9b1b-45378bfa47c1/avatar","permissionIds":["45A2EF45-7D46-EB11-8100-00155D081D0B"],"departmentIds":["b6ff11d8-0be7-4e99-b8c7-5a7ab501c69b"],"roleIds":["e0bf1302-d145-eb11-8100-00155d081d0b"],"skillIds":["8F8D3782-B4FD-48C4-BA6B-82F0B7B53D7F"]}],"departments":[{"id":"accbe492-8bf1-42a3-abaa-8bd221175c0e","name":"markting","description":"markting departments","isAvailableInLiveChat":true,"isAvailableInTicketingAndMessaging":true,"offlineMessageMailTo":"toAllAgents","offlineMessageEmailAddresses":"andy@comm100.com","isAvailableInVoice":true,"agentIds":["3CA2EF45-7D46-EB11-8100-00155D081D0B"]}],"departmentIds":["6fd98c99-f183-4247-bdda-47491426e577"],"agentIds":["48A2EF45-7D46-EB11-8100-00155D081D0B"]}]}
Remove the Bot_ChatbotSmartTrigger

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