API - Smart Rule

Description
These APIs are used to perform CRUD operations on the Smart Rules.
Get All Smart Rules for Interactive Channel
GET /Campaign/api/interact/rest/v2/channels/{icIdOrName}/strategies/{strategyIdOrName}/rules?page=0&size=50
Parameters
Parameters Default Values
page 0
size 50
Output
Table 1. Response Codes
Success 200 Ok
Error 400 Inputs provided for the API are not valid.
Server Error 500 Internal Server Error. For more details, check the logs.
Example: Content-Type: application/json
{

"content": [

{
  "cellCode": "string",
  "cellId": 0,
  "effectiveDate": 0,
  "eligibilityPredicate": "string",
  "eligibilityPredicateEnabled": true,
  "eligibilityPredicateId": 0,
  "enabled": true,
  "expirationDate": 0,
  "id": 0,
  "learningMode": 0,
  "learningModelId": 0,
  "lmName": "string",
  "maxScore": true,
  "offerAttrExpressions": [
    {
      "attrId": 0,
      "attrName": "string",
      "expression": "string",
      "ruleId": 0
    }
  ],
  "offerCode": "string",
  "offerId": 0,
  "offerName": "string",
  "ruleGroupName": "string",
  "ruleGroups": [
    {
      "description": "string",
      "id": 0,
      "name": "string"
    }
  ],
  "ruleName": "string",
  "samplePercent": 0,
  "score": 0,
  "scorePredicate": "string",
  "scorePredicateEnabled": true,
  "scorePredicateId": 0,
  "segmentId": 0,
  "segmentName": "string",
  "suppressCount": 0,
  "zoneId": 0,
  "zoneName": "string"
}],

"page": {

"pageNumber": 0,

"totalElements": 0,

"totalPages": 0,

"size": 0,
"hasNext": false,

"hasPrev": false

}

}
Get Smart Rule by Rule Id
GET /Campaign/api/interact/rest/v2/channels/{icIdOrName}/strategies/{strategyIdOrName}/rules/{ruleIdOrName}
Parameters
Parameters Default Values
page 0
size 50
Output
Table 2. Response Codes
Success 200 Ok
Error 400 Inputs provided for the API are not valid.
Server Error 500 Internal Server Error. For more details, check the logs.
Example: Content-Type: application/json
{
  "cellCode": "string",
  "cellId": 0,
  "effectiveDate": 0,
  "eligibilityPredicate": "string",
  "eligibilityPredicateEnabled": true,
  "eligibilityPredicateId": 0,
  "enabled": true,
  "expirationDate": 0,
  "id": 0,
  "learningMode": 0,
  "learningModelId": 0,
  "lmName": "string",
  "maxScore": true,
  "offerAttrExpressions": [
    {
      "attrId": 0,
      "attrName": "string",
      "expression": "string",
      "ruleId": 0
    }
  ],
  "offerCode": "string",
  "offerId": 0,
  "offerName": "string",
  "ruleGroupName": "string",
  "ruleGroups": [
    {
      "description": "string",
      "id": 0,
      "name": "string"
    }
  ],
  "ruleName": "string",
  "samplePercent": 0,
  "score": 0,
  "scorePredicate": "string",
  "scorePredicateEnabled": true,
  "scorePredicateId": 0,
  "segmentId": 0,
  "segmentName": "string",
  "suppressCount": 0,
  "zoneId": 0,
  "zoneName": "string"
}
Save Rules
POST /Campaign/api/interact/rest/v2/channels/{icIdOrName}/strategies/{strategyIdOrName}/rules
Input
Body Parameter – Content-Type:application/json
{
  "toAdd": [
    {
      "cellCode": "string",
      "cellId": 0,
      "effectiveDate": 0,
      "eligibilityPredicate": "string",
      "eligibilityPredicateEnabled": true,
      "eligibilityPredicateId": 0,
      "enabled": true,
      "expirationDate": 0,
      "id": 0,
      "learningMode": 0,
      "learningModelId": 0,
      "lmName": "string",
      "maxScore": true,
      "offerAttrExpressions": [
        {
          "attrId": 0,
          "attrName": "string",
          "expression": "string",
          "ruleId": 0
        }
      ],
      "offerCode": "string",
      "offerId": 0,
      "offerName": "string",
      "ruleGroupName": "string",
      "ruleGroups": [
        {
          "description": "string",
          "id": 0,
          "name": "string"
        }
      ],
      "ruleName": "string",
      "samplePercent": 0,
      "score": 0,
      "scorePredicate": "string",
      "scorePredicateEnabled": true,
      "scorePredicateId": 0,
      "segmentId": 0,
      "segmentName": "string",
      "suppressCount": 0,
      "zoneId": 0,
      "zoneName": "string"
    }
  ],
  "toDelete": [
    0
  ],
  "toUpdate": [
    {
      "cellCode": "string",
      "cellId": 0,
      "effectiveDate": 0,
      "eligibilityPredicate": "string",
      "eligibilityPredicateEnabled": true,
      "eligibilityPredicateId": 0,
      "enabled": true,
      "expirationDate": 0,
      "id": 0,
      "learningMode": 0,
      "learningModelId": 0,
      "lmName": "string",
      "maxScore": true,
      "offerAttrExpressions": [
        {
          "attrId": 0,
          "attrName": "string",
          "expression": "string",
          "ruleId": 0
        }
      ],
      "offerCode": "string",
      "offerId": 0,
      "offerName": "string",
      "ruleGroupName": "string",
      "ruleGroups": [
        {
          "description": "string",
          "id": 0,
          "name": "string"
        }
      ],
      "ruleName": "string",
      "samplePercent": 0,
      "score": 0,
      "scorePredicate": "string",
      "scorePredicateEnabled": true,
      "scorePredicateId": 0,
      "segmentId": 0,
      "segmentName": "string",
      "suppressCount": 0,
      "zoneId": 0,
      "zoneName": "string"
    }
  ]
}
Output
Table 3. Response Codes
Success 201 Created
Error 400 Bad Request
Server Error 500 Internal/Server Error
Delete
DELETE /Campaign/api/interact/rest/v2/channels/{icIdOrName}/strategies/{strategyIdOrName}/rules
Input
Body Parameter – Content-Type:application/json
{
  "ids": [
    0
  ]
}
Output
Table 4. Response Codes
Success 204 No Content
Error 400 Bad Request
Server Error 500 Internal/Server Error