//If MarketingAreas are existing iterate over each
contact.MarketingAreas.each { area ->
if(area != "") {
//Marketing Area is a mandatory field within the ODATA Metadata. However it could be sent EMPTY which denotes MarketingArea is not enabled in the backend and accepted.
if (area.InteractionContactMktgArea == null) {
throw new NullPointerException("No Marketing Area");
}
marketingArea = area.InteractionContactMktgArea;
def marketingAreaBatchPart = new XmlSlurper().parseText("<batchChangeSetPart><method>PUT</method><headers><header><headerName>Sap-Cuan-ForceSynchronousProcessing</headerName><headerValue>X</headerValue></header></headers><uri>MarketingAreas(ContactID='${contactID}',ContactOrigin='${contactOrigin}',InteractionContactMktgArea='${marketingArea}')</uri><MarketingAreas><MarketingArea><ContactOrigin>${contactOrigin}</ContactOrigin></MarketingArea></MarketingAreas></batchChangeSetPart>");
//marketingAreaBatchPart.MarketingPermissions.MarketingPermission.appendNode(area.getBody());
contactPermissionBatchPayload.batchChangeSet.appendNode(marketingAreaBatchPart);
}
};
contact.MarketingAreas.replaceNode {};
{
"Contact": {
"ContactID": "xxtest8@xxxxx.de",
"ContactOrigin": "NEWSLETTER_MASPBW",
"FirstName": "Haino",
"LastName": "Hallo",
"BirthDate": "1977-08-12",
"EmailAddress": "xxtest8@xxxxx.de",
"PhoneNumber": "+4912312456781231239",
"MobileNumber": "+4998127654123123321",
"Country": "DE",
"CityName": "Walldorf",
"StreetName": "Dietmar-Hopp-Allee",
"AddressHouseNumber": "20",
"GenderCode": "1",
"ContactPostalCode": "24105",
"IsConsumer": true,
"MarketingPermissions": [
{
"ContactPermissionID": "xxtest8@xxxxx.de",
"ContactPermissionOrigin": "EMAIL",
"MarketingArea": "Area1",
"CommunicationMedium": "EMAIL",
"CommunicationCategory": "40",
"ContactPermission": "Y",
"PermissionUTCDateTime": "2019-01-11T07:09:35",
"CommunicationDirection": "O",
"PermissionSourceSystem": "SYSTEM",
"PermissionIsExplicit": true,
"IsConfirmationRequired": true
}
],
"MarketingAreas": [
{
"InteractionContactMktgArea": "Area1"
}
],
"Interactions": [
{
"CommunicationMedium": "WEB",
"InteractionType": "WEBSITE_VISIT",
"InteractionTimeStampUTC": "2018-03-06T12:12:26",
"SourceSystemType": "COM",
"SourceSystem": "SAP_MERCH_SHOP",
"MarketingArea": "Area1",
"InteractionContent": "2018-03-28 Interaction Product Test 01",
"InteractionInterests": [
{
"ItemOfInterest": "FUSSBALL",
"InteractionIntrstWeightingFctr": 1,
"InteractionIntrstSentimentVal": 1
}
]
}
]
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
8 | |
3 | |
2 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 |