API - FlexOffers

Description
This APIs are used to perform CRUD operations on FlexOffers.
Get All FlexOffer for Interact Channel
GET /Campaign/api/interact/rest/v2/channels/{icIdOrName}/offermappings
Output
Table 1. Response Codes
Success 200 Ok
Error 400 Inputs provided for the API are invalid
Server Error 500 Internal Server Error
Example: Content-Type: application/json
{
    "content": [
        {
            "offerMapingId": 783,
            "offerMappingName": "OfferAttTest",
            "offerMappingDesc": "OfferAttTest",
            "physicalTableName": "UACI_OfferMapping781",
            "sourceFileName": "TestOfferMappingX_44.csv",
            "fields": [],
            "serverGroups": [
                {
                    "name": "cat1-sg1",
                    "table": "UACI_OfferMapping781"
                }
            ],
            "createDate": 1591792745917,
            "createBy": 2,
            "updateDate": 1591801790540,
            "updateBy": 2,
            "sourceSG": null,
            "override": false,
            "lastProdDepTime": null
        },
        {
            "offerMapingId": 769,
            "offerMappingName": "IndexTest8",
            "offerMappingDesc": "IndexTest8",
            "physicalTableName": "UACI_OfferMapping765",
            "sourceFileName": "TestOfferMappingX_44.csv",
            "fields": [],
            "serverGroups": [
                {
                    "name": "cat1-sg1",
                    "table": "UACI_OfferMapping765"
                }
            ],
            "createDate": 1591187372970,
            "createBy": 2,
            "updateDate": 1591460329090,
            "updateBy": 2,
            "sourceSG": null,
            "override": false,
            "lastProdDepTime": null
        },
        {
            "offerMapingId": 720,
            "offerMappingName": "MyTestToday1",
            "offerMappingDesc": "MyTestToday1",
            "physicalTableName": "UACI_OfferMapping719",
            "sourceFileName": "TestOfferMappingX_44.csv",
            "fields": [],
            "serverGroups": [],
            "createDate": 1589906153593,
            "createBy": 2,
            "updateDate": 1590166442077,
            "updateBy": 2,
            "sourceSG": null,
            "override": false,
            "lastProdDepTime": null
        }
    ],
    "page": {
        "pageNumber": 0,
        "totalElements": 3,
        "totalPages": 1,
        "size": 2000,
        "hasNext": false,
        "hasPrev": false
    }
}
Get FlexOffer by ID or Name
GET /Campaign/api/interact/rest/v2/channels/{icIdOrName}/offermappings/{offermappingIdOrName}
Output
Table 2. Response Codes
Success 200 Ok
Error 400 Inputs provided for the API are invalid
Server Error 500 Internal Server Error
Example: Content-Type: application/json
{
    "offerMapingId": 783,
    "offerMappingName": "OfferAttTest",
    "offerMappingDesc": "OfferAttTest",
    "physicalTableName": "UACI_OfferMapping781",
    "sourceFileName": "TestOfferMappingX_44.csv",
    "fields": [
        {
            "name": "OfferMappingRowID",
            "displayName": "OfferMappingRowID",
            "type": "LONG",
            "value": null,
            "relation": null,
            "size": 20,
            "dynamic": false,
            "dateFormat": null
        },
        {
            "name": "OfferID",
            "displayName": "OfferID",
            "type": "LONG",
            "value": null,
            "relation": null,
            "size": 20,
            "dynamic": false,
            "dateFormat": null
        },
        {
            "name": "OfferName",
            "displayName": "OfferName",
            "type": "STRING",
            "value": null,
            "relation": null,
            "size": 130,
            "dynamic": false,
            "dateFormat": null
        },
        {
            "name": "OfferCode",
            "displayName": "OfferCode",
            "type": "STRING",
            "value": null,
            "relation": null,
            "size": 320,
            "dynamic": false,
            "dateFormat": null
        },
        {
            "name": "CellID",
            "displayName": "CellID",
            "type": "LONG",
            "value": null,
            "relation": null,
            "size": 20,
            "dynamic": false,
            "dateFormat": null
        },
        {
            "name": "CellCode",
            "displayName": "CellCode",
            "type": "STRING",
            "value": null,
            "relation": null,
            "size": 64,
            "dynamic": false,
            "dateFormat": null
        },
        {
            "name": "ZoneID",
            "displayName": "ZoneID",
            "type": "LONG",
            "value": null,
            "relation": null,
            "size": 20,
            "dynamic": false,
            "dateFormat": null
        },
        {
            "name": "ZoneName",
            "displayName": "ZoneName",
            "type": "STRING",
            "value": null,
            "relation": null,
            "size": 64,
            "dynamic": false,
            "dateFormat": null
        },
        {
            "name": "EligibilityPredicateEnabled",
            "displayName": "EligibilityPredicateEnabled",
            "type": "BIT",
            "value": null,
            "relation": null,
            "size": 1,
            "dynamic": false,
            "dateFormat": null
        },
        {
            "name": "EligibilityPredicate",
            "displayName": "EligibilityPredicate",
            "type": "STRING",
            "value": null,
            "relation": null,
            "size": 4000,
            "dynamic": false,
            "dateFormat": null
        },
        {
            "name": "MarketerScore",
            "displayName": "MarketerScore",
            "type": "INTEGER",
            "value": null,
            "relation": null,
            "size": 11,
            "dynamic": false,
            "dateFormat": null
        },
        {
            "name": "ScorePredicateEnabled",
            "displayName": "ScorePredicateEnabled",
            "type": "BIT",
            "value": null,
            "relation": null,
            "size": 1,
            "dynamic": false,
            "dateFormat": null
        },
        {
            "name": "ScorePredicate",
            "displayName": "ScorePredicate",
            "type": "STRING",
            "value": null,
            "relation": null,
            "size": 4000,
            "dynamic": false,
            "dateFormat": null
        },
        {
            "name": "LearningMode",
            "displayName": "LearningMode",
            "type": "INTEGER",
            "value": null,
            "relation": null,
            "size": 11,
            "dynamic": false,
            "dateFormat": null
        },
        {
            "name": "LearningModelId",
            "displayName": "LearningModelId",
            "type": "LONG",
            "value": null,
            "relation": null,
            "size": 20,
            "dynamic": false,
            "dateFormat": null
        },
        {
            "name": "ParameterizedOfferAttribute",
            "displayName": "ParameterizedOfferAttribute",
            "type": "STRING",
            "value": null,
            "relation": null,
            "size": 4000,
            "dynamic": false,
            "dateFormat": null
        },
        {
            "name": "EffectiveDate",
            "displayName": "EffectiveDate",
            "type": "DATE",
            "value": null,
            "relation": null,
            "size": 20,
            "dynamic": false,
            "dateFormat": null
        },
        {
            "name": "ExpirationDate",
            "displayName": "ExpirationDate",
            "type": "DATE",
            "value": null,
            "relation": null,
            "size": 20,
            "dynamic": false,
            "dateFormat": null
        },
        {
            "name": "EnableState",
            "displayName": "EnableState",
            "type": "INTEGER",
            "value": null,
            "relation": null,
            "size": 11,
            "dynamic": false,
            "dateFormat": null
        },
        {
            "name": "CreateDate",
            "displayName": "CreateDate",
            "type": "DATE",
            "value": null,
            "relation": null,
            "size": 23,
            "dynamic": false,
            "dateFormat": null
        },
        {
            "name": "CreateBy",
            "displayName": "CreateBy",
            "type": "INTEGER",
            "value": null,
            "relation": null,
            "size": 11,
            "dynamic": false,
            "dateFormat": null
        },
        {
            "name": "UpdateDate",
            "displayName": "UpdateDate",
            "type": "DATE",
            "value": null,
            "relation": null,
            "size": 23,
            "dynamic": false,
            "dateFormat": null
        },
        {
            "name": "UpdateBy",
            "displayName": "UpdateBy",
            "type": "INTEGER",
            "value": null,
            "relation": null,
            "size": 11,
            "dynamic": false,
            "dateFormat": null
        },
        {
            "name": "salary",
            "displayName": "salary",
            "type": "LONG",
            "value": null,
            "relation": null,
            "size": 20,
            "dynamic": true,
            "dateFormat": null
        }
    ],
    "serverGroups": [
        {
            "name": "cat1-sg1",
            "table": "UACI_OfferMapping781"
        }
    ],
    "createDate": 1591792745917,
    "createBy": 2,
    "updateDate": 1591999065463,
    "updateBy": 2,
    "sourceSG": null,
    "override": false,
    "lastProdDepTime": null
}
Update FlexOffer
PUT /Campaign/api/interact/rest/v2/channels/{icIdOrName}/offermappingins/{offermappingIdOrName}
Input
{
"offerMappingName":"OfferAttTest",
"offerMappingDesc":"OfferAttTestXYZ"
}
Body Parameter – Content-Type: application/json
Output
Table 3. Response Codes
Success 202 Accepted
Miscellaneous 207 Miscellaneous
Error 400 Bad Request
Server Error 500 Internal Server Error
Example: Content-Type: application/json
{
    "offerMapingId": 783,
    "offerMappingName": "CopyYYYYY",
    "offerMappingDesc": "CopyOfferMappingAABBAAAA",
    "physicalTableName": "UACI_OfferMapping781",
    "sourceFileName": "TestOfferMappingX_44.csv",
    "fields": [],
    "serverGroups": [
        {
            "name": "cat1-sg1",
            "table": "UACI_OfferMapping781"
        }
    ],
    "createDate": 1591792745917,
    "createBy": 2,
    "updateDate": 1592225960050,
    "updateBy": 2,
    "sourceSG": null,
    "override": false,
    "lastProdDepTime": null
}

Copy FlexOffer
PUT /Campaign/api/interact/rest/v2/channels/{icIdOrName}/offermappingins/{offermappingIdOrName}??targetServerGroup=cat1-sg1
Input
Body Parameter – Content-Type: application/json
{
"offerMappingName":"OfferAttTest",
"offerMappingDesc":"OfferAttTestXYZAA",
"physicalTableName":"UACI_OfferMapping781",
"sourceFileName":"TestOfferMappingX_44.csv"
}
Output
Table 4. Response Codes
Accepted 202 Accepted
Error 400 Bad Request
Server Error 500 Internal Server Error
Example: Content-Type: application/json
{
  "offerMapingId":783,
  "offerMappingName":"TestUpdateOM",
  "offerMappingDesc":"TestUpdateOMA",
  "physicalTableName":"UACI_OfferMapping781",
  "sourceFileName":"TestOfferMappingX_44.csv",
  "fields":[
			 {
				"name":"OfferMappingRowID",
				"displayName":"OfferMappingRowID",
				"type":"LONG",
				"value":null,
				"relation":null,
				"size":20,
				"dynamic":false,
				"dateFormat":null
			},
			{
				"name":"OfferID",
				"displayName":"OfferID",
				"type":"LONG",
				"value":null,
				"relation":null,
				"size":20,
				"dynamic":false,
				"dateFormat":null
			},
			{
				"name":"OfferName",
				"displayName":"OfferName",
				"type":"STRING",
				"value":null,
				"relation":null,
				"size":130,
				"dynamic":false,
				"dateFormat":null
			},
			{ 
				"name":"OfferCode",
				"displayName":"OfferCode",
				"type":"STRING",
				"value":null,
				"relation":null,
				"size":320,
				"dynamic":false,
				"dateFormat":null
			},
			{
				"name":"CellID",
				"displayName":"CellID",
				"type":"LONG",
				"value":null,
				"relation":null,
				"size":20,
				"dynamic":false,
				"dateFormat":null
			},
			{
				"name":"CellCode",
				"displayName":"CellCode",
				"type":"STRING",
				"value":null,
				"relation":null,
				"size":64,
				"dynamic":false,
				"dateFormat":null
			},
			{
				"name":"ZoneID",
				"displayName":"ZoneID",
				"type":"LONG",
				"value":null,
				"relation":null,
				"size":20,
				"dynamic":false,
				"dateFormat":null
			}
	],
	"serverGroups":[{
			    "name":"cat1-sg1",
			    "table":"UACI_OfferMapping781"
			 }
			],
	"createDate":1591792745917,
	"createBy":2,
	"updateDate":1592235975133,
	"updateBy":2,
	"sourceSG":null,
	"override":false,
	"lastProdDepTime":null
}
Delete FlexOffer
DELETE Campaign/api/interact/rest/v2/channels/{icIdOrName}/offermappingins/{offermappingIdOrName}
Output
Table 5. Response Codes
No Content 200 Ok
Error 400 Bad Request
Server Error 500 Internal Server Error
Create New FlexOffer
Post/Campaign/api/interact/rest/v2/channels/{icIdOrName}/offermappings
Output
Table 6. Response Codes
No Content 201 Not Created
Error 400 Bad Request
Server Error 500 Internal Server Error
{
  "offerMappingName":"TestDoc2",
  "physicalTableName":"testDoc2",
  "offerMappingDesc":"TestDoc2",
  "override":false
}}
Example: Content-Type: application/json
{
"offerMapingId": 792,
"offerMappingName": "TestDoc2",
"offerMappingDesc": "TestDoc2",
"physicalTableName": "testDoc2",
"sourceFileName": "",
"fields": [
{
"name": "OfferMappingRowID",
"displayName": "OfferMappingRowID",
"type": "LONG",
"value": null,
"relation": null,
"size": 20,
"dynamic": false,
"dateFormat": null
},
{
"name": "OfferID",
"displayName": "OfferID",
"type": "LONG",
"value": null,
"relation": null,
"size": 20,
"dynamic": false,
"dateFormat": null
},
{
"name": "OfferName",
"displayName": "OfferName",
"type": "STRING",
"value": null,
"relation": null,
"size": 130,
"dynamic": false,
"dateFormat": null
},
{
"name": "OfferCode",
"displayName": "OfferCode",
"type": "STRING",
"value": null,
"relation": null,
"size": 320,
"dynamic": false,
"dateFormat": null
},
{
"name": "CellID",
"displayName": "CellID",
"type": "LONG",
"value": null,
"relation": null,
"size": 20,
"dynamic": false,
"dateFormat": null
},
{
"name": "CellCode",
"displayName": "CellCode",
"type": "STRING",
"value": null,
"relation": null,
"size": 64,
"dynamic": false,
"dateFormat": null
},
{
"name": "ZoneID",
"displayName": "ZoneID",
"type": "LONG",
"value": null,
"relation": null,
"size": 20,
"dynamic": false,
"dateFormat": null
},
{
"name": "ZoneName",
"displayName": "ZoneName",
"type": "STRING",
"value": null,
"relation": null,
"size": 64,
"dynamic": false,
"dateFormat": null
},
{
"name": "EligibilityPredicateEnabled",
"displayName": "EligibilityPredicateEnabled",
"type": "BIT",
"value": null,
"relation": null,
"size": 1,
"dynamic": false,
"dateFormat": null
},
{
"name": "EligibilityPredicate",
"displayName": "EligibilityPredicate",
"type": "STRING",
"value": null,
"relation": null,
"size": 4000,
"dynamic": false,
"dateFormat": null
},
{
"name": "MarketerScore",
"displayName": "MarketerScore",
"type": "INTEGER",
"value": null,
"relation": null,
"size": 11,
"dynamic": false,
"dateFormat": null
},
{
"name": "ScorePredicateEnabled",
"displayName": "ScorePredicateEnabled",
"type": "BIT",
"value": null,
"relation": null,
"size": 1,
"dynamic": false,
"dateFormat": null
},
{
"name": "ScorePredicate",
"displayName": "ScorePredicate",
"type": "STRING",
"value": null,
"relation": null,
"size": 4000,
"dynamic": false,
"dateFormat": null
},
{
"name": "LearningMode",
"displayName": "LearningMode",
"type": "INTEGER",
"value": null,
"relation": null,
"size": 11,
"dynamic": false,
"dateFormat": null
},
{
"name": "LearningModelId",
"displayName": "LearningModelId",
"type": "LONG",
"value": null,
"relation": null,
"size": 20,
"dynamic": false,
"dateFormat": null
},
{
"name": "ParameterizedOfferAttribute",
"displayName": "ParameterizedOfferAttribute",
"type": "STRING",
"value": null,
"relation": null,
"size": 4000,
"dynamic": false,
"dateFormat": null
},
{
"name": "EffectiveDate",
"displayName": "EffectiveDate",
"type": "DATE",
"value": null,
"relation": null,
"size": 20,
"dynamic": false,
"dateFormat": null
},
{
"name": "ExpirationDate",
"displayName": "ExpirationDate",
"type": "DATE",
"value": null,
"relation": null,
"size": 20,
"dynamic": false,
"dateFormat": null
},
{
"name": "EnableState",
"displayName": "EnableState",
"type": "INTEGER",
"value": null,
"relation": null,
"size": 11,
"dynamic": false,
"dateFormat": null
},
{
"name": "CreateDate",
"displayName": "CreateDate",
"type": "DATE",
"value": null,
"relation": null,
"size": 23,
"dynamic": false,
"dateFormat": null
},
{
"name": "CreateBy",
"displayName": "CreateBy",
"type": "INTEGER",
"value": null,
"relation": null,
"size": 11,
"dynamic": false,
"dateFormat": null
},
{
"name": "UpdateDate",
"displayName": "UpdateDate",
"type": "DATE",
"value": null,
"relation": null,
"size": 23,
"dynamic": false,
"dateFormat": null
},
{
"name": "UpdateBy",
"displayName": "UpdateBy",
"type": "INTEGER",
"value": null,
"relation": null,
"size": 11,
"dynamic": false,
"dateFormat": null
}
],
"serverGroups": [],
"createDate": 1592238515390,
"createBy": 2,
"updateDate": 1592238515390,
"updateBy": 2,
"sourceSG": null,
"override": false,
"lastProdDepTime": null
}

Create New FlexOffer from database table
Post/Campaign/api/interact/rest/v2/channels/{icIdOrName}/offermappings
Output
Table 7. Response Codes
No Content 201 Not Created
Error 400 Bad Request
Server Error 500 Internal Server Error
{
"offerMappingName": "TestDoc4",
"sourceSG": "defaultServerGroup",
"sourceFileName": "UACI_OfferMapping793",
"offerMappingDesc": "TestDoc4",
"override": false
}
Example: Content-Type: application/json
Similar response like Create New FlexOffer
Create FlexOffer from imported csvFile
Post/Campaign/api/interact/rest/v2/channels/{icIdOrName}/offermappings/uploadfile
Output
Table 8. Response Codes
No Content 201 Not Created
Error 400 Bad Request
Server Error 500 Internal Server Error
Form Data:
file: (binary)
{
	"offerMappingName": "TestDoc5",
	"offerMappingDesc": "TestDoc5",
	"override": false,
	"fields": [
				{
				"name": "offer id",
				"type": "LONG",
				"value": null,
				"dateFormat": null,
				"size": 20
				},
				{
				"name": "salary",
				"type": "LONG",
				"value": null,
				"dateFormat": null,
				"size": 11
				}
	]
}

Example: Content-Type: application/json

Similar response like create new flex offer mapping

Get All Server Groups
Post/servergroups
Output
Table 9. Response Codes
Success 200 Ok
Error 400 Inputs provided for the API are invalid
Server Error 500 Internal Server Error
Example: Content-Type: application/json
[
    "cat1-sg1",
    "defaultServerGroup"
]
Get All Tables by Server Group
GET Campaign/api/interact/rest/v2/tables?serverGroupName=defaultServerGroup
Output
Table 10. Response Codes
Success 200 Ok
Error 400 Inputs provide for the API are invalid
Server Error 500 Internal Server Error
Example: Content-Type: application/json
[
    "DF_AUDIENCE",
    "DF_AUDIENCE_FIELD",
    "DF_AUDIENCE_TABLE",
    "DF_CONFIG",
    "DF_FIELDCONSTRAINT",
    "DF_FILTER",
    "DF_LOGICAL_FIELD",
    "MYOFFERLIST",
    "MYOFFERLISTABC",
    "MySpecialOffer",
    "TMP_UACI_OfferMapping770",
    "TableMap25",
    "TableMap25XY",
    "Test041820202"
]