Product Information
How to use the new Contact OData API for SAP Marketing Cloud 1711
Introduction
Welcome to the blog posts of the SAP CX Services Marketing Practice.
We are happy to share our experience with you around Marketing Business, Technology and Analytics.
You want to see this and more blogs from us? Click here
Background
As you have probably already seen with the new Release of SAP Marketing Cloud there is a bunch of new public APIs available.
You can find the full list on api.sap.com. Some of the most important are listed below:
- Contacts (OData API “API_MKT_CONTACT_SRV”)
- Interaction Contacts (OData API “API_MKT_INTERACTION_CONTACT“)
- Corporate Accounts (OData API “API_MKT_CORPORATE_ACCOUNT“)
- Interactions (OData API “API_MKT_INTERACTION_SRV“)
Those APIs offer new features and functionalities like batch support and dedicated services for each business object.
In regards to the different Public APIs for SAP Marketing Cloud the Application help What’s new section for 1711 recommends the following:
“As of this release, we strongly recommend that you use one of these APIs instead of using the OData service CUAN_IMPORT_SRV.”
The statement clearly shows the importance for your projects to get familiar with those APIs.
In this blog post we will pick the new Contact API as an example to learn how to read and write contact data via the Postman Rest Client.
You want to see this and more blogs from us? Click here
Your SAP CX Services Marketing Practice.
Hello Mark,
It was a great blog and it is good to see that SAP is releasing their OData API(S) in API API Management using swagger like format. Is SAP planning to deprecate CUAN_IMPORT*** api?
However, the API is violating REST best principles. We need to have proper CRUD (POST/GET/PUT/PATCH) operation for all entity sets (some of them have only get) and I understand re-implementing Old ABAP Odata services may not be cost effective but I think API's SAP releasing to outside world shouse use OAS REST design principles and API management should deal with internal complexities of mapping external endpoint to internal OData endpoint.
Also, The API doesn't have a mechanism to create/update postal opt in and opt in date . It asks for two keys Marketing Permission ID and Contact ID ( Unlike e-mail and phone we will not have have specific ID) for postal or paper opt in .
Though CUAN also doesn't follow OAS rest principles, it atleast provides a mechanism to update marketing permission postal opt in.
Hello,
When you do a GET of contacts, the response is in XML.
But to do a POST, you need to use JSON...
Is there a way to harmonize this? e.g. that a GET is also received in JSON?
Kr,
Joyca
You can use header Accept: application/json in the GET request to receive the response as JSON
Hi Maik,
It was very nice blog and easy to simulate using Postman. Just need one more help, how to implement this API in HCI/CPI. We have a requirement to update contact marketing permissions using UUID through CSV file. Please guide the steps to implement this API.
Regards,
Ali.
Thanks Maik - This is just the article I what I was looking for. I am able to run the POST through the SAP Netweaver gateway client. I can see the HTTP/1.1 204 No Content. I can see my entries in the Import Monitor application and they are showing In Process
However, when I try to open up the Fiori app for Inspect Contact or Analyze Contact Origin Data, I get the error "Could not open app. Please try again later". I have a Hybris system on AWS provisioned through CAL which we upgraded to 1709. I copied all of the roles that were in the YMKT_ALL user but many of the tiles do not start the corresponding apps correctly.
Are there some steps I need to do to get the entries from In Process to Success?
Regards,
Jay
Hi Jay,
please find some information about the staging area here: https://help.sap.com/viewer/0f9408e4921e4ba3bb4a7a1f75f837a7/1808.500/en-US/66340fe5e8d84d02b21d3af04476b3f5.html
They explain the staging area there: See: "By default, data processing for contacts, interaction contacts, corporate accounts, or marketing permissions is asynchronous. In most cases an OK response, such as a receipt notification, is returned almost immediately. An exception to this would be data uploads that might contain severe errors, such as parse or format errors, and so would not return an OK response but an error message. The data you upload lands in a staging area, where it is then further processed. You can change the default setting to synchronous processing by setting the property Sap-Cuan-ForceSynchronousProcessing to True. In this case, any error messages are returned as soon as they are detected."
That's why the contacts are in process.
For the inspect contact app I would try different browsers or otherwise it should be an authorization issue.
BR
Maik
Hi Maik,
Thanks for your very prompt answer. We did pass in "Sap-Cuan-ForceSynchronousProcessing: X" and then we were able to see the issues with the data which was helpful.
We were also able to get the Inspect Contact application to work after adding the permissions and also enabling the underlying OData service.
Now we are facing the csrf issue since the Hybris system through CAL issues with the certificate.
Thanks,
Jay
Hi Maik,
How can I post a contact using postman for example