Hello experts,
I am trying to resolve a Marketing Permissions issue involving an oData call to the API_MKT_CONTACT_SRV service for setting Contact Permission values. Before contacting you I've read through the SAP Integration Guide for Contacts and Johnannes Hirling's "How to Import Contact Data via OData Services..." post, which provides an example of this in the Entity Path – MarketingPermissions section.
So we have code in an iflow that produces the following batch request that's equivalent to Johannes's example, just in XML instead of JSON format. To elaborate, our batchParts request is used for updating the ContactPermission value from 'N' to 'Y' and is structured like this:
<?xml version="1.0" encoding="UTF-8"?> <batchParts> <batchChangeSet> <batchChangeSetPart> <method>PUT</method> <MarketingPermissions> <MarketingPermission> <ContactID>booyakasha@mailinator.com</ContactID> <ContactOrigin>BOSCHTOOLS_WEBSITE</ContactOrigin> <ContactPermissionID>booyakasha@mailinator.com</ContactPermissionID> <ContactPermissionOrigin>BOSCHTOOLS_WEBSITE</ContactPermissionOrigin> <MarketingArea>PT-BI-NA</MarketingArea> <CommunicationMedium>EMAIL</CommunicationMedium> <CommunicationCategory/> <ContactPermission>Y</ContactPermission> <PermissionUTCDateTime>2019-01-01T09:00:00</PermissionUTCDateTime> <PermissionSourceCommMedium>WEB</PermissionSourceCommMedium> <PermissionIsExplicit>true</PermissionIsExplicit> </MarketingPermission> </MarketingPermissions> </batchChangeSetPart> </batchChangeSet> </batchParts>
The oData configuration within the iflow looks like this:
Address: https://<myservername>-api.s4hana.ondemand.com/sap/opu/odata/sap/API_MKT_CONTACT_SRVOperation Details: Update(PUT)Resource Path: MarketingPermissions('ContactID','ContactPermissionID','ContactPermissionOrigin','MarketingArea','CommunicationMedium','CommunicationCategory')Fields: PermissionSourceCommMedium,PermissionIsExplicit,PermissionUTCDateTime,ContactID,ContactPermissionID,ContactPermissionOrigin,MarketingArea,CommunicationMedium,CommunicationCategory
It's also worth noting that the corresponding Contact record has already been created via a prior step in the iflow, so we're using the http PUT method here to simply update the ContactPermission value of the MarketingPermission segment for the given Contact.
Anyway after the iflow code is executed, I'm not seeing that the ContactPermission value is changed. After some looking I noticed the error "Fewer Than 2 IDs Provided" is appearing in Import Monitor app for all of my test requests. Here's an example of the failed data record as it appears in the Import Monitor notification pane:
CONTACT_ID: booyakasha@mailinator.com CONTACT_ORIGIN: BOSCHTOOLS_WEBSITE MKT_AREA_ID: PT-BI-NA CONTACT_FACET_ID: booyakasha@mailinator.com CONTACT_FACET_ID_ORIGIN: BOSCHTOOLS_WEBSITE OUTBOUND_COMM_MEDIUM: WEB OPT_IN: Y COMM_MEDIUM: EMAIL IA_TIMESTAMP: 20190101091500.0 EXPLICIT: X mp-get-responsexml.txtIC_TYPE: 00
Not sure what additional IDs are needed to perform the Marketing Permissions update outside of the ones listed in the SAP Integration Guide for Contacts, which are also listed in the Resource Path above. I am able to see the underlying ContactOriginData record(s) already created in the Contacts step by running the following GET request in POSTMAN:
https://myservername-api.s4hana.ondemand.com/sap/opu/odata/SAP/API_MKT_CONTACT_SRV;v=0002/ContactOriginData(ContactID='booyakasha@mailinator.com',ContactOrigin='BOSCHTOOLS_WEBSITE')/MarketingPermissions?$filter=ContactPermissionID eq 'booyakasha@mailinator.com' and CommunicationMedium eq 'EMAIL'&$orderby=PermissionUTCDateTime desc
(Curiously, two Marketing Permission records were created via a single Contacts PUT request, which differ by ContactPermissionOrigin value. I'll attach the actual response message to this question.)
Please let me know what other information I can provide in order for you to offer some insight, suggestions, or additional reading to solve this problem.
Thank you!
John Kormanec