- 25 Jul 2022
- 6 Minutes to read
- Print
- DarkLight
Dynamic Campaign
- Updated on 25 Jul 2022
- 6 Minutes to read
- Print
- DarkLight
Dynamic Campaign
Dynamic Campaigns
- Dynamic Campaigns ManageGET livechat/dynamicCampaignConfig
- Get a single Dynamic CampaignPUT livechat/dynamicCampaignConfig
- Update the Dynamic Campaign
Dynamic Campaign Rules
- Dynamic Campaign Rules ManageGET livechat/dynamicCampaignRules
- Get the list of Dynamic Campaign RulesGET livechat/dynamicCampaignRules/{id}
- Get a single Dynamic Campaign RulePOST livechat/dynamicCampaignRules
- Create a new Dynamic Campaign RulePOST livechat/dynamicCampaignRules/{id}:disable
- Disable the Dynamic Campaign RulePOST livechat/dynamicCampaignRules/{id}:enable
- Enable the Dynamic Campaign RulePUT livechat/dynamicCampaignRules/{id}
- Update the Dynamic Campaign RuleDELETE livechat/dynamicCampaignRules/{id}
- Remove the Dynamic Campaign Rule
Dynamic Campaign JSON Format
Dynamic Campaign is represented as simple flat JSON objects with the following keys:
Name | Type | Description |
---|---|---|
defaultCampaignId | guid | Id of the default campaign. |
dynamicCode | string | The code of this campaign. |
dynamicCampaignRules | dynamicCampaignRules[] | Reference to Dynamic Campaign Rule. |
Rule Condition JSON Format:
Name | Type | Description | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
id | guid | Id of the rule condition. | ||||||||||||||||||||||||||||||||||
dynamicCampaignRuleId | guid | Id of the dynamic campaign rule. | ||||||||||||||||||||||||||||||||||
operator | string | Allowed values are "is", "contains", "notContains", "isMoreThan", "isLessThan", "isNot", "isNotLessThan", "isNotMoreThan", "regularExpression", "isOneOf", "isNotIn", "dateNotEqualTo", "before", "after", "dateEqualTo". | ||||||||||||||||||||||||||||||||||
value | string | Value of the rule condition. | ||||||||||||||||||||||||||||||||||
order | integer | Order of the rule condition. | ||||||||||||||||||||||||||||||||||
fieldName | string | Field name of the rule condition.
| ||||||||||||||||||||||||||||||||||
description | string |
Get a single Dynamic Campaign
GET livechat/dynamicCampaignConfig
Parameters:
No Parameters
Response:
Example
Sample Request:
curl https://api11.comm100.io/v4/livechat/dynamicCampaignConfig \
-X 'GET' \
-H 'Authorization: Bearer {access_token}' \
Response:
HTTP/1.1 200 OK
{
"defaultCampaignId": "d5c5e6f5-8167-4406-8d31-e50ef878d926",
"dynamicCode": "\n?<div></div>\n?\n?",
"dynamicCampaignRules": [
{
"id": "D3AF5329-7C46-EB11-8100-00155D081D0B",
"name": "Dynamic Campaign Rule",
"isEnabled": false,
"conditionMetType": "all",
"logicalExpression": "(1 or 2) and (3 or 4)",
"targetCampaignId": "9b572219-890d-4ebc-892b-cb89b7ea3e5f",
"order": 1,
"dynamicCampaignRuleConditions": [
{
"id": "E5AA999A-263E-42E0-BC83-025A0DB9076E",
"dynamicCampaignRuleId": "8B917411-9887-4CF6-AAEE-94543271BFBA",
"operator": "is",
"value": "Windows 8.1",
"order": 1,
"fieldName": "{!Visitor.Number of visits}",
"description": ""
}
],
"targetCampaign": {
"id": "9b572219-890d-4ebc-892b-cb89b7ea3e5f",
"name": "test",
"description": "",
"language": "english"
}
}
]
}
Update the Dynamic Campaign
PUT livechat/dynamicCampaignConfig
Parameters:
Name | Type | in | Required | Description |
---|---|---|---|---|
defaultCampaignId | guid | body | yes | Id of the default campaign. |
dynamicCampaignRules | dynamicCampaignRules[] | body | no | Reference to Dynamic Campaign Rule. |
Response:
Example
Sample Request:
curl https://api11.comm100.io/v4/livechat/dynamicCampaignConfig \
-X 'PUT' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-D '{"defaultCampaignId": "9b572219-890d-4ebc-892b-cb89b7ea3e5f","dynamicCampaignRules": [{"name": "Dynamic Campaign Rule","isEnabled": false,"conditionMetType": "all","logicalExpression": "(1 or 2) and (3 or 4)","targetCampaignId": "9b572219-890d-4ebc-892b-cb89b7ea3e5f","order": 1,"dynamicCampaignRuleConditions": [{"operator": "is","value": "Windows 8.1","order": 1,"fieldName": "{!Visitor.Number of visits}","description": ""}],"targetCampaign": {"id": "9b572219-890d-4ebc-892b-cb89b7ea3e5f","name": "test","description": "test","language": "english"}}]}'
Response:
HTTP/1.1 200 OK
{
"defaultCampaignId": "9b572219-890d-4ebc-892b-cb89b7ea3e5f",
"dynamicCode": "",
"dynamicCampaignRules": [
{
"id": "66693949-ef5a-41dc-be7f-8e56ca4d6199",
"name": "Dynamic Campaign Rule",
"isEnabled": false,
"conditionMetType": "all",
"logicalExpression": "",
"targetCampaignId": "9b572219-890d-4ebc-892b-cb89b7ea3e5f",
"order": 1,
"dynamicCampaignRuleConditions": [
{
"id": "6ad595c0-eaa0-4817-bb54-92e45970b561",
"dynamicCampaignRuleId": "66693949-ef5a-41dc-be7f-8e56ca4d6199",
"fieldName": "{!Visitor.Number of visits}",
"operator": "is",
"value": "Windows 8.1",
"order": 1,
"description": ""
}
],
"targetCampaign": {
"id": "9b572219-890d-4ebc-892b-cb89b7ea3e5f",
"name": "jacktest",
"description": "",
"language": "english"
}
}
]
}
Dynamic Campaign Rule JSON Format
Dynamic Campaign Rule is represented as simple flat JSON objects with the following keys:
Name | Type | Description |
---|---|---|
id | guid | Id of the dynamic campaign rule. |
name | string | Name of the dynamic campaign rule. |
isEnabled | bool | Whether the dynamic campaign rule is enabled or not. |
conditionMetType | string | Allowed values are "all", "any", "logicalExpression". |
logicalExpression | string | Logical expression of the dynamic campaign rule. |
targetCampaignId | guid | Target campaign of the dynamic campaign rule. |
order | integer | Order of the dynamic campaign rule. |
dynamicCampaignRuleConditions | dynamicCampaignRuleConditions[] | Reference to Rule Condition. |
Get the list of Dynamic Campaign Rules
GET livechat/dynamicCampaignRules
Parameters:
No Parameters
Response:
An array of Dynamic Campaign Rule
Example
Sample Request:
curl https://api11.comm100.io/v4/livechat/dynamicCampaignRules \
-X 'GET' \
-H 'Authorization: Bearer {access_token}' \
Response:
HTTP/1.1 200 OK
[
{
"id": "D3AF5329-7C46-EB11-8100-00155D081D0B",
"name": "Dynamic Campaign Rule",
"isEnabled": false,
"conditionMetType": "all",
"logicalExpression": "(1 or 2) and (3 or 4)",
"targetCampaignId": "9b572219-890d-4ebc-892b-cb89b7ea3e5f",
"order": 1,
"dynamicCampaignRuleConditions": [
{
"id": "E5AA999A-263E-42E0-BC83-025A0DB9076E",
"dynamicCampaignRuleId": "8B917411-9887-4CF6-AAEE-94543271BFBA",
"operator": "is",
"value": "Windows 8.1",
"order": 1,
"fieldName": "{!Visitor.Number of visits}",
"description": ""
}
],
"targetCampaign": {
"id": "9b572219-890d-4ebc-892b-cb89b7ea3e5f",
"name": "test",
"description": "",
"language": "english"
}
}
]
Get a single Dynamic Campaign Rule
GET livechat/dynamicCampaignRules/{id}
Parameters:
No Parameters
Response:
Example
Sample Request:
curl https://api11.comm100.io/v4/livechat/dynamicCampaignRules/D3AF5329-7C46-EB11-8100-00155D081D0B \
-X 'GET' \
-H 'Authorization: Bearer {access_token}' \
Response:
HTTP/1.1 200 OK
{
"id": "D3AF5329-7C46-EB11-8100-00155D081D0B",
"name": "Dynamic Campaign Rule",
"isEnabled": false,
"conditionMetType": "all",
"logicalExpression": "(1 or 2) and (3 or 4)",
"targetCampaignId": "9b572219-890d-4ebc-892b-cb89b7ea3e5f",
"order": 1,
"dynamicCampaignRuleConditions": [
{
"id": "E5AA999A-263E-42E0-BC83-025A0DB9076E",
"dynamicCampaignRuleId": "8B917411-9887-4CF6-AAEE-94543271BFBA",
"operator": "is",
"value": "Windows 8.1",
"order": 1,
"fieldName": "{!Visitor.Number of visits}",
"description": ""
}
],
"targetCampaign": {
"id": "9b572219-890d-4ebc-892b-cb89b7ea3e5f",
"name": "test",
"description": "",
"language": "english"
}
}
Create a new Dynamic Campaign Rule
POST livechat/dynamicCampaignRules
Parameters:
Name | Type | in | Required | Description |
---|---|---|---|---|
name | string | body | yes | Name of the dynamic campaign rule. |
isEnabled | bool | body | no | Whether the dynamic campaign rule is enabled or not. |
conditionMetType | string | body | yes | Allowed values are "all", "any", "logicalExpression". |
logicalExpression | string | body | yes when conditionMetType is logicalExpression | Logical expression of the dynamic campaign rule. |
targetCampaignId | guid | body | yes | Target campaign of the dynamic campaign rule. |
order | integer | body | no | Order of the dynamic campaign rule. |
dynamicCampaignRuleConditions | dynamicCampaignRuleConditions[] | body | no | Reference to Rule Condition. |
Response:
Example
Sample Request:
curl https://api11.comm100.io/v4/livechat/dynamicCampaignRules \
-X 'POST' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-D '{"name":"DynamicCampaignRule","isEnabled":false,"conditionMetType":"all","logicalExpression":"(1or2)and(3or4)","targetCampaignId":"9b572219-890d-4ebc-892b-cb89b7ea3e5f","order":1,"dynamicCampaignRuleConditions":[{"operator":"is","value":"Windows8.1","order":1,"fieldName":"{!Visitor.Numberofvisits}","description":""}],"targetCampaign":{"id":"9b572219-890d-4ebc-892b-cb89b7ea3e5f","name":"test","description":"","language":"english"}}'
Response:
HTTP/1.1 201 Created
{
"id": "D3AF5329-7C46-EB11-8100-00155D081D0B",
"name": "Dynamic Campaign Rule",
"isEnabled": false,
"conditionMetType": "all",
"logicalExpression": "(1 or 2) and (3 or 4)",
"targetCampaignId": "9b572219-890d-4ebc-892b-cb89b7ea3e5f",
"order": 1,
"dynamicCampaignRuleConditions": [
{
"id": "E5AA999A-263E-42E0-BC83-025A0DB9076E",
"dynamicCampaignRuleId": "8B917411-9887-4CF6-AAEE-94543271BFBA",
"operator": "is",
"value": "Windows 8.1",
"order": 1,
"fieldName": "{!Visitor.Number of visits}",
"description": ""
}
],
"targetCampaign": {
"id": "9b572219-890d-4ebc-892b-cb89b7ea3e5f",
"name": "test",
"description": "",
"language": "english"
}
}
Disable the Dynamic Campaign Rule
POST livechat/dynamicCampaignRules/{id}:disable
Parameters:
No Parameters
Response:
Example
Sample Request:
curl https://api11.comm100.io/v4/livechat/dynamicCampaignRules/D3AF5329-7C46-EB11-8100-00155D081D0B:disable \
-X 'POST' \
-H 'Authorization: Bearer {access_token}' \
Response:
HTTP/1.1 200 OK
{
"id": "D3AF5329-7C46-EB11-8100-00155D081D0B",
"name": "Dynamic Campaign Rule",
"isEnabled": false,
"conditionMetType": "all",
"logicalExpression": "(1 or 2) and (3 or 4)",
"targetCampaignId": "9b572219-890d-4ebc-892b-cb89b7ea3e5f",
"order": 1,
"dynamicCampaignRuleConditions": [
{
"id": "E5AA999A-263E-42E0-BC83-025A0DB9076E",
"dynamicCampaignRuleId": "8B917411-9887-4CF6-AAEE-94543271BFBA",
"operator": "is",
"value": "Windows 8.1",
"order": 1,
"fieldName": "{!Visitor.Number of visits}",
"description": ""
}
],
"targetCampaign": {
"id": "9b572219-890d-4ebc-892b-cb89b7ea3e5f",
"name": "test",
"description": "",
"language": "english"
}
}
Enable the Dynamic Campaign Rule
POST livechat/dynamicCampaignRules/{id}:enable
Parameters:
No Parameters
Response:
Example
Sample Request:
curl https://api11.comm100.io/v4/livechat/dynamicCampaignRules/D3AF5329-7C46-EB11-8100-00155D081D0B:enable \
-X 'POST' \
-H 'Authorization: Bearer {access_token}' \
Response:
HTTP/1.1 200 OK
{
"id": "D3AF5329-7C46-EB11-8100-00155D081D0B",
"name": "Dynamic Campaign Rule",
"isEnabled": true,
"conditionMetType": "all",
"logicalExpression": "(1 or 2) and (3 or 4)",
"targetCampaignId": "9b572219-890d-4ebc-892b-cb89b7ea3e5f",
"order": 1,
"dynamicCampaignRuleConditions": [
{
"id": "E5AA999A-263E-42E0-BC83-025A0DB9076E",
"dynamicCampaignRuleId": "8B917411-9887-4CF6-AAEE-94543271BFBA",
"operator": "is",
"value": "Windows 8.1",
"order": 1,
"fieldName": "{!Visitor.Number of visits}",
"description": ""
}
],
"targetCampaign": {
"id": "9b572219-890d-4ebc-892b-cb89b7ea3e5f",
"name": "test",
"description": "",
"language": "english"
}
}
Update the Dynamic Campaign Rule
PUT livechat/dynamicCampaignRules/{id}
Parameters:
Name | Type | in | Required | Description |
---|---|---|---|---|
name | string | body | yes | Name of the dynamic campaign rule. |
isEnabled | bool | body | no | Whether the dynamic campaign rule is enabled or not. |
conditionMetType | string | body | yes | Allowed values are "all", "any", "logicalExpression". |
logicalExpression | string | body | yes when conditionMetType is logicalExpression | Logical expression of the dynamic campaign rule. |
targetCampaignId | guid | body | yes | Target campaign of the dynamic campaign rule. |
order | integer | body | no | Order of the dynamic campaign rule. |
dynamicCampaignRuleConditions | dynamicCampaignRuleConditions[] | body | no | Reference to Rule Condition. |
Response:
Example
Sample Request:
curl https://api11.comm100.io/v4/livechat/dynamicCampaignRules/D3AF5329-7C46-EB11-8100-00155D081D0B \
-X 'PUT' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-D '{"name":"DynamicCampaignRule","isEnabled":false,"conditionMetType":"all","logicalExpression":"(1or2)and(3or4)","targetCampaignId":"9b572219-890d-4ebc-892b-cb89b7ea3e5f","order":1,"dynamicCampaignRuleConditions":[{"operator":"is","value":"Windows8.1","order":1,"fieldName":"{!Visitor.Numberofvisits}","description":""}],"targetCampaign":{"id":"9b572219-890d-4ebc-892b-cb89b7ea3e5f","name":"test","description":"","language":"english"}}'
Response:
HTTP/1.1 200 OK
{
"id": "D3AF5329-7C46-EB11-8100-00155D081D0B",
"name": "Dynamic Campaign Rule",
"isEnabled": false,
"conditionMetType": "all",
"logicalExpression": "(1 or 2) and (3 or 4)",
"targetCampaignId": "9b572219-890d-4ebc-892b-cb89b7ea3e5f",
"order": 1,
"dynamicCampaignRuleConditions": [
{
"id": "E5AA999A-263E-42E0-BC83-025A0DB9076E",
"dynamicCampaignRuleId": "8B917411-9887-4CF6-AAEE-94543271BFBA",
"operator": "is",
"value": "Windows 8.1",
"order": 1,
"fieldName": "{!Visitor.Number of visits}",
"description": ""
}
],
"targetCampaign": {
"id": "9b572219-890d-4ebc-892b-cb89b7ea3e5f",
"name": "test",
"description": "",
"language": "english"
}
}
Remove the Dynamic Campaign Rule
DELETE livechat/dynamicCampaignRules/{id}
Parameters:
No Parameters
Response:
No Content
Example
Sample Request:
curl https://api11.comm100.io/v4/livechat/dynamicCampaignRules/D3AF5329-7C46-EB11-8100-00155D081D0B \
-X 'DELETE' \
-H 'Authorization: Bearer {access_token}' \
Response:
HTTP/1.1 204 No Content