Welcome to the blog posts of the SAP CX Services Marketing Practice.

We are happy to share with you our experience around Marketing Business, Technology and Analytics.

You want to see more blogs from us? Click here.

Overview

With this blog post we will provide a guide on how to setup SAP Marketing Cloud to receive Interactions, such as posts from social media or product reviews, using SAP Cloud Platform Integration.

We will go through the basic configuration steps and basic Iflow design and help you to understand how to use the available APIs on SAP Marketing Cloud.

    1. Create interaction in SAP Marketing Cloud from Twitter

 

    1. Create and update integrations in SAP Marketing Cloud

This blog post does extend the existing documentation providing a examples and use cases, but does not replace or repeat information already documented in the official SAP API documentation.

Product version

For this Blog Post following product release version has been used.

SAP Marketing Cloud Release: 1805 Upgrade Schedule: https://www.sap.com/documents/2017/01/867629d8-a27c-0010-82c7-eda71af511fa.html
SAP Cloud Platform integration Build number: 2.42.11 Upgrade Schedule: https://blogs.sap.com/2018/06/08/sap-cloud-platform-integration-how-we-do-software-updates/

 

Since we have short release cycles, the content in this blog post might look different from what you find on your SAP Marketing Cloud and SAP Cloud Platform Integration system.

    • SAP Marketing Cloud: Quarterly releases
    • SAP Cloud Platform Integration: Monthly releases

 

Scope

In this blog post we cover end-to-end scenarios maintaining interaction data using the Interaction OData API and Compound Import Service described in the API documentation listed below.

Documentation: https://help.sap.com/viewer/0f9408e4921e4ba3bb4a7a1f75f837a7/1802%20500/en-US/06526bdbae42455ba69a4a…

We will  cover the following scenarios:

    • Create interactions in SAP Marketing Cloud using the Interactions OData API (API_MKT_INTERACTION_SRV) and Compound Import Service (CUAN_IMPORT_SRV)

 

    • Read, Update, and Delete interactions using the Interactions OData API (API_MKT_INTERACTION_SRV)

The OData Service functionalities are illustrated using the following Scenarios.

Scenario Action OData Service(s) used
Import Twitter Statuses to SAP Marketing Cloud Create Interaction
    • Interactions OData API (API_MKT_INTERACTION_SRV)
    • Compound Import Service (CUAN_IMPORT_SRV)
Import Product Reviews to Marketing Cloud Create, read, update, and delete interactions
    • Interactions OData API (API_MKT_INTERACTION_SRV)

 

Prerequisites

 

    • SAP Marketing Cloud

 

    • SAP Cloud Platform integration

 

    • Postman (or any other tool to send a http request)

 

    • XML tool (Intellij IDEA, Notepad++ or any other tool to read XML formatted messages)

 

References

 

 

 

 

 

 

 

 

 

Available Service on SAP Marketing Cloud for importing Interactions

To import Interactions, multiple services are provided. In this Blog Post we focus on the two general services available to import interactions. For business documents (leads, opportunities, sales orders and so on), it is recommended to use the API Service CUAN_BUSINESS_DOCUMENT_IMP_SRV, since it provides an upsert function and updates an already existing entry depending on timestamp information.

Here, we are using the following services:

    • Interactions OData API (API_MKT_INTERACTION_SRV)

 

    • Compound Import Service (CUAN_IMPORT_SRV)

To understand the differences between batch processing and deep insert refer to the following documentation:

 

 

 

With the current version of the SAP Marketing Cloud APIs (August 2018), The APIs are implemented with OData Version 2.0)

Before you start, watch the Integration Guide for SAP Marketing Cloud video:

What is an Interaction on SAP Marketing Cloud

First, what is an interaction on SAP Marketing Cloud?

An Interaction describes any type of of communication or information exchange that can be tied back to a contact. Generally, interactions can be associated with a known or unknown contact describing an activity (e.g. EMail opened) or response type (e.g. Hard bounce). Interactions are assigned to a interaction type (e.g. SOCIAL_POSTING for a post on social media) and Communication Medium (e.g. TW for Twitter). Interaction find broad usage in SAP Marketing Cloud, for example for segmentation, score calculation, campaign triggers and many more.

Import Twitter Statuses to SAP Marketing Cloud

This configuration guide provides an overview of the sequence on configuration steps mandatory to the Integration scenario running.

A standard integration package is available to integrate Twitter with SAP Marketing Cloud. It is recommended using the standard content for integrating Twitter with SAP Marketing Cloud.
We have chosen Twitter to illustrate connectivity with an external application and SAP Marketing Cloud and use of different OData Services to import the same interaction typoe. This can be used as training exerciseSAP Marketing Cloud – Twitter Integration: https://api.sap.com/package/SAPS4HANAMarketingCloudTwitterIntegration?section=OverviewHow to load Twitter data into SAP Marketing Cloud: https://youtu.be/evvkbDu0e24

Use Case:
You are planning to collect data from Twitter with specific tags or mentions, to enrich the SAP marketing Cloud contact with interactions from Twitter.

For many use cases interactions are one-time events where no update or deletion is expected. For this scenario we are only considering the creation of interaction without implementing any logic for updates or deletion. This makes the implementation a lot easier.

Twitter status updates are imported as Social Posting interactions with creating a contact record with a Twitter ID Origin on SAP Marketing Cloud.
To building the best record the contact needs and ID or additional parameters to match & merge the contact on SAP Marketing Cloud. The Golden Record build is not covered in this blog post. You can connect contact records from different sources using a RaaS tools like Gigya.How to import Contact Data via OData Services to SAP Hybris Marketing: https://blogs.sap.com/2018/04/02/how-to-import-contact-data-via-odata-services-to-sap-hybris-marketi…Gigya Integration to SAP Hybris Marketing Cloud: https://blogs.sap.com/2017/03/14/gigya-integration-to-sap-hybris-marketing/

 

SAP Marketing Cloud (MKT)

 

    • In SAP Marketing Cloud, navigate to the Communication Management Apps

 

    • (Optional) Create a Communication User (depends on the Authentication option you select)

 

    • Create a Communication System with your CPI tenant as your communication partner

 

    • Create a Communication Arrangement with Communication Scenario SAP_COM_0206 and SAP_COM_0003

For a more details and step-by-step description on how to set up communication with SAP Marketing Cloud, refer to this Blog Post: https://blogs.sap.com/2018/04/02/how-to-import-contact-data-via-odata-services-to-sap-hybris-marketi…

Twitter Configuration

To call the Twitter API you need to create a Twitter account an App first.

Before creating the Twitter App, make yourself familiar with the Twitter API documentation, following the instructions for user, limitations, permissions, and authentication.

Twitter API documentation: https://developer.twitter.com/en/docs/ads/general/guides/getting-started.html

Logon to your Twitter Account and create a new Twitter App (https://apps.twitter.com/).

Open the created Twitter app and note the Consumer Key and Consumer Secret. This is needed to create the access token.

Create encoded Bearer token credentials (access token)
Review the documentation: https://dev.twitter.com/oauth/application-only
Create a BASE64 encoded access token using the template below
Base 64 encoder: https://www.base64encode.org/

Consumer Key (API Key) 5hYsCB3xxY
Consumer Secret (API Secret) ZP7Kepph9
Consumer Key (API Key)
RFC 1738 encoded
5hYsCB3xx
Consumer Secret (API Secret)
RFC 1738 encoded
ZP7Kepph9HDZxRD9iXGsFeiqwfZ9
Bearer token credentials 5hYsCB3xxY:ZP7Kepph9
Base64 encoded bearer token credentials NWhZc0NCM3h4WEa3c0c0hAAAAZ3RpNEVlTw==

 

(Optional) Download and install Postman

The role ESBMessaging.send must be assigned to the user that makes the call to CPI.

Note: You can use any client that can send a HTTP request with user-password or client certificate authentication to the created http endpoint.

POST /http/InteractionAPITwitterStatusUpdates/start HTTP/1.1
Host: <SAP Cloud Platform Integration Tenant Management URL>
Content-Type: application/xml

<data>
<!-- 1: CUAN_IMPORT_SRV / 2: API_MKT_INTERACTION_SRV -->
<route>2</route>
<tags>#SAP</tags>
</data>

 

SAP Cloud Platform Integration (CPI)

Before configuring the Iflow on Cloud Platform Integration SAP Marketing Cloud communication needs to be configured and the Twitter app created.
In this scenario we are creating interactions in SAP Marketing Cloud using different services.

Procedure:

    • Logon to your SAP Cloud Platform Cockpit

 

    • Create a technical user on the SAP Cloud Platform Cockpit

 

    • Logon to SAP Cloud Platform Integration and navigate to Design

 

    • Create a new Integration Package

 

    • Create, design and configure a new Iflow

 

    • Deploy the Iflow

 

 Twitter Integration Iflow:

 

    1. Instead having a Timer Event to trigger this Iflow we created a Sender Channel. This is for testing purpose to define dynamic parameters (e.g. tags, route, etc.).

 

    1. First the Twitter token is fetched and then then the request to retrieve the Twitter status updates.
      In this example we are using both, the Compound Import Service and Interaction Service to give an example for both services.
      The Router Integration Pattern routes the message based on the defined condition for the “route” property.

 

    1. Compound Import Service (CUAN_IMPORT_SRV)
      Import the interaction to SAP Marketing Cloud using the Compound Import Service

 

    1. Interaction API (API_MKT_INTERACTION_SRV)
      Import the interaction to SAP Marketing Cloud using the Interaction API

Note: A Twitter adapter is available on CPI. We have used the HTTP adapter for explaining how the Twitter API works.

Mandatory values to be provided by the Sender

tags e.g. #sap
route “1” for CUAN_IMPORT_SRV
“2” for API_MKT_INTERACTION_SRV

Create Request

We’re submitting a request to SAP Cloud Platform Integration with some essential information we need in our IFlow.

 

POST /http/InteractionAPITwitterStatusUpdates/start HTTP/1.1

 

Host: e0000-iflmap.avtsbhf.eux.hana.ondemand.com

 

Content-Type: application/xml

 

Authorization: Basic ABCABCABC

 

<data>
<!-- 1: CUAN_IMPORT_SRV / 2: API_MKT_INTERACTION_SRV -->
<route>2</route>
<tags>#SAP</tags>
</data>

Persist parameters

When the message is received on CPI the route and tags are extracted and saved into exchange parameter.

 

Make and request to the Twitter API.

When using the Twitter adapter on CPI, this is taken care of and the Twitter adapter just needs to be configured.

 

Here, we have modified the message header to contain the Content-Type and Authorization header required from the Twitter API.

 

The first HTTP request retrieved the Twitter access token.

 

The access token is extracted from the Twitter response payload and saved in the message header.

 

With the valid access token we can define a request to the twitter API. Review the Twitter API documentation for further information (https://developer.twitter.com/en/docs/ads/general/guides/getting-started.html)

 

Convert response to XML

Since the Message Mapping and other 9integration patterns expect a XML formatted file we need to convert the Twitter JSON response to XML.

 

Check for Twitter status updates

The first Router checks the Twitter response if there are any status updates.

 

Route message to OData Service

The second router sends the message to the CUAN_IMPORT_SRV or API_MKT_INTERACTION_SRV Service depending on what was defined in the original inbound message.

 

We are using the CUAN_IMPORT_SRV or the API_MKT_INTERACTION_SRV to illustrate both services.

Both path follow the same logic, but since the Odata Service is designed in differently, the Message Mappings create different message payloads.

 

Monitor messages

In the Message Monitoring you can review the processed messages.

 

Review the Contact Profile on SAP Marketing Cloud

Contact Profile with imported Social Media post interaction.

 

The end-user should not see any difference between a social post interaction that was imported from any of both services.

 

Review the imported Interaction on SAP Marketing Cloud

To check the interactions only, open the Browse Interaction Data App and filter for interaction type “SOCIAL_POSTING” and Communication Medium “TW”. You can set additional filters to refine your search.

 

Open the interaction and review the tag attached to the interaction.

 

 

 

Message Processing Logging Scripts

The Iflow can be used to follow through an example how messages can be processed. This Iflow contains some scripts for logging message payloads, headers, and properties. This is not best practice for productive integration scenarios but useful for explaining the message processing process of this Iflow. Alternatively, the Trace functionality on CPI can be used to monitor the message payloads and headers.

Following scripts have been added to illustrate the message transformation and have no impact on the message processing logic.

010_Twitter-Auth-Response Twitter access token response
020_Twitter-Statuses-Response JSON Twitter Response
030_Twitter-Response-XML Twitter Response converted to XML
040_Message-after-Mapping Twitter response mapped to Odata Service message structure
050_MKC-Response SAP Marketing Response

 

Message Mapping

There are differences in how the message structures are mapped target structures.
Both services have different structure due to design and functionality.
The CUAN_IMPORT_SRV uses deep insert to import data to SAP Marketing Cloud whereas with the API_MKT_INTERACTION_SRV you can enable batch processing for mass imports.

Note: In this example only some fields are mapped. This is an example message mapping.

Message Mapping for CUAN_IMPORT_SRV

Left: Twitter response message structure

Right: CUAN_IMPORT_SRV message structure

Message Mapping API_MKT_INTERACTION_SRV

Left: Twitter response message structure

Right: API_MKT_INTERACTION_SRV message structure

Note: In this example, the tags are populated from the message exchange property through a custom function.

 

Message receives on SAP Marketing Cloud

To see how the actual message looks like, we tested this scenario and monitored the inbound message on SAP Gateway. Reviewing the received message you see that both structures are different but contain the same set of information. As mentioned above both services process the messages differently and provide different functionalities.

CUAN_IMPORT_SRV message after the message Mapping.

Inbound message for route 1 with the Compound Import Service (CUAN_IMPORT_SRV)

Message after the Message Mapping on CPI

<?xml version="1.0" encoding="UTF-8"?>
<ImportHeaders>
	<ImportHeader>
		<Timestamp>2018-07-19T15:13:26</Timestamp>
		<SourceSystemType>HCI</SourceSystemType>
		<SourceSystemId>cd6n08</SourceSystemId>
		<Id/>
		<Interactions>
			<Interaction>
				<Timestamp>2018-07-19T15:12:57</Timestamp>
				<SourceObjectId>123456793245687</SourceObjectId>
				<SourceDataUrl>https://twitter.com/BirgitCarnatz/status/123456793245687</SourceDataUrl>
				<InteractionType>SOCIAL_POSTING</InteractionType>
				<ContentData>Twitter content</ContentData>
				<ContactIdOrigin>TW</ContactIdOrigin>
				<ContactId>131313131331</ContactId>
				<CommunicationMedium>TW</CommunicationMedium>
				<Key/>
				<Tags>
					<InteractionTag>
						<Tag>#SAP</Tag>
						<TagType>TWITTERSEARCH</TagType>
					</InteractionTag>
				</Tags>
			</Interaction>
			<Interaction>
				<Timestamp>2018-07-19T15:12:56</Timestamp>
				<SourceObjectId>1019963305639731200</SourceObjectId>
				<SourceDataUrl>https://twitter.com/SAP_Jarret/status/1019963305639731200</SourceDataUrl>
				<InteractionType>SOCIAL_POSTING</InteractionType>
				<ContentData>Twitter content</ContentData>
				<ContactIdOrigin>TW</ContactIdOrigin>
				<ContactId>2525252525</ContactId>
				<CommunicationMedium>TW</CommunicationMedium>
				<Key/>
				<Tags>
					<InteractionTag>
						<Tag>#SAP</Tag>
						<TagType>TWITTERSEARCH</TagType>
					</InteractionTag>
				</Tags>
			</Interaction>
		</Interactions>
	</ImportHeader>
</ImportHeaders>

CUAN_IMPORT_SRV message received in SAP Marketing Cloud.

Inbound message for route 1 with the Compound Import Service (CUAN_IMPORT_SRV)

<?xml version="1.0" encoding="utf-8"?>
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xml:base="https://<sap-marketing-cloud-host>/sap/opu/odata/sap/CUAN_IMPORT_SRV/">
		<id>https://<sap-marketing-cloud-host>/sap/opu/odata/sap/CUAN_IMPORT_SRV/ImportHeaders('')</id>
			<title type="text">ImportHeaders</title>
			<updated>2018-08-14T13:23:41.208Z</updated>
			<category term="CUAN_IMPORT_SRV.ImportHeader" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
			<link href="ImportHeaders('')" rel="edit" title="ImportHeader"/>
			<link href="ImportHeaders('')/Interactions" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Interactions" title="Interactions" type="application/atom+xml;type=feed">
				<m:inline>
					<feed xml:base="https://<sap-marketing-cloud-host>/sap/opu/odata/sap/CUAN_IMPORT_SRV/">
							<id>https://<sap-marketing-cloud-host>/sap/opu/odata/sap/CUAN_IMPORT_SRV/Interactions</id>
								<title type="text">Interactions</title>
								<updated>2018-08-14T13:23:41.217Z</updated>
								<author>
									<name/>
								</author>
								<link href="Interactions" rel="self" title="Interactions"/>
								<entry>
									<id>https://<sap-marketing-cloud-host>/sap/opu/odata/sap/CUAN_IMPORT_SRV/Interactions('')</id>
										<title type="text">Interactions</title>
										<updated>2018-08-14T13:23:41.217Z</updated>
										<category term="CUAN_IMPORT_SRV.Interaction" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
										<link href="Interactions('')" rel="edit" title="Interaction"/>
										<link href="Interactions('')/Tags" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Tags" title="Tags" type="application/atom+xml;type=feed">
											<m:inline>
												<feed xml:base="https://<sap-marketing-cloud-host>/sap/opu/odata/sap/CUAN_IMPORT_SRV/">
														<id>https://<sap-marketing-cloud-host>/sap/opu/odata/sap/CUAN_IMPORT_SRV/InteractionTags</id>
															<title type="text">InteractionTags</title>
															<updated>2018-08-14T13:23:41.217Z</updated>
															<author>
																<name/>
															</author>
															<link href="InteractionTags" rel="self" title="InteractionTags"/>
															<entry>
																<id>https://<sap-marketing-cloud-host>/sap/opu/odata/sap/CUAN_IMPORT_SRV/InteractionTags(TagType='TWITTERSEARCH',Tag='%23SAP')</id>
																	<title type="text">InteractionTags</title>
																	<updated>2018-08-14T13:23:41.217Z</updated>
																	<category term="CUAN_IMPORT_SRV.InteractionTag" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
																	<link href="InteractionTags(TagType='TWITTERSEARCH',Tag='%23SAP')" rel="edit" title="InteractionTag"/>
																	<content type="application/xml">
																		<m:properties>
																			<d:TagType>TWITTERSEARCH</d:TagType>
																			<d:Tag>#SAP</d:Tag>
																		</m:properties>
																	</content>
																</entry>
															</feed>
														</m:inline>
													</link>
													<content type="application/xml">
														<m:properties>
															<d:Key/>
															<d:CommunicationMedium>TW</d:CommunicationMedium>
															<d:ContactId>2233333333331111111</d:ContactId>
															<d:ContactIdOrigin>TW</d:ContactIdOrigin>
															<d:ContentData>SAP Successfactors improves first year retention of the employees. To learn more about this contact… https://t.co/cXvmWkFzZA</d:ContentData>;
															<d:InteractionType>SOCIAL_POSTING</d:InteractionType>
															<d:SourceDataUrl>https://twitter.com/sfonlinetrainer/status/1111111111111111111</d:SourceDataUrl>
															<d:SourceObjectId>1111111111111111111</d:SourceObjectId>
															<d:Timestamp>2018-08-14T13:20:11.0000000</d:Timestamp>
														</m:properties>
													</content>
												</entry>
												<entry>
													<id>https://<sap-marketing-cloud-host>/sap/opu/odata/sap/CUAN_IMPORT_SRV/Interactions('')</id>
														<title type="text">Interactions</title>
														<updated>2018-08-14T13:23:41.219Z</updated>
														<category term="CUAN_IMPORT_SRV.Interaction" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
														<link href="Interactions('')" rel="edit" title="Interaction"/>
														<link href="Interactions('')/Tags" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Tags" title="Tags" type="application/atom+xml;type=feed">
															<m:inline>
																<feed xml:base="https://<sap-marketing-cloud-host>/sap/opu/odata/sap/CUAN_IMPORT_SRV/">
																		<id>https://<sap-marketing-cloud-host>/sap/opu/odata/sap/CUAN_IMPORT_SRV/InteractionTags</id>
																			<title type="text">InteractionTags</title>
																			<updated>2018-08-14T13:23:41.219Z</updated>
																			<author>
																				<name/>
																			</author>
																			<link href="InteractionTags" rel="self" title="InteractionTags"/>
																			<entry>
																				<id>https://<sap-marketing-cloud-host>/sap/opu/odata/sap/CUAN_IMPORT_SRV/InteractionTags(TagType='TWITTERSEARCH',Tag='%23SAP')</id>
																					<title type="text">InteractionTags</title>
																					<updated>2018-08-14T13:23:41.22Z</updated>
																					<category term="CUAN_IMPORT_SRV.InteractionTag" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
																					<link href="InteractionTags(TagType='TWITTERSEARCH',Tag='%23SAP')" rel="edit" title="InteractionTag"/>
																					<content type="application/xml">
																						<m:properties>
																							<d:TagType>TWITTERSEARCH</d:TagType>
																							<d:Tag>#SAP</d:Tag>
																						</m:properties>
																					</content>
																				</entry>
																			</feed>
																		</m:inline>
																	</link>
																	<content type="application/xml">
																		<m:properties>
																			<d:Key/>
																			<d:CommunicationMedium>TW</d:CommunicationMedium>
																			<d:ContactId>123123123</d:ContactId>
																			<d:ContactIdOrigin>TW</d:ContactIdOrigin>
																			<d:ContentData>Redesigning #SAP #SuccessFactors for #Android: Bringing the Consumer Experience to the Enterprise https://t.co/36rOBbjFtl</d:ContentData>;
																			<d:InteractionType>SOCIAL_POSTING</d:InteractionType>
																			<d:SourceDataUrl>https://twitter.com/lukemarson/status/2222222222222222222</d:SourceDataUrl>
																			<d:SourceObjectId>2222222222222222222</d:SourceObjectId>
																			<d:Timestamp>2018-08-14T13:20:00.0000000</d:Timestamp>
																		</m:properties>
																	</content>
																</entry>
															</feed>
														</m:inline>
													</link>
													<content type="application/xml">
														<m:properties>
															<d:Id/>
															<d:Timestamp>2018-08-14T13:23:40</d:Timestamp>
															<d:SourceSystemType>HCI</d:SourceSystemType>
															<d:SourceSystemId>cd6n08</d:SourceSystemId>
														</m:properties>
													</content>
												</entry>

API_MKT_INTERACTION_SRV message after the message Mapping.

Inbound message for route 2 with the Interaction API (API_MKT_INTERACTION_SRV)

<?xml version="1.0" encoding="UTF-8"?>
<batchParts>
	<batchChangeSet>
		<batchChangeSetPart>
			<method>POST</method>
			<Interactions>
				<Interaction>
					<InteractionUUID>00000000-0000-0000-0000-000000000000</InteractionUUID>
					<InteractionContactId>12345678</InteractionContactId>
					<CommunicationMedium>TW</CommunicationMedium>
					<InteractionContent>Twitter tweet content</InteractionContent>
					<InteractionContentSubject>User Name: Username1</InteractionContentSubject>
					<InteractionContactOrigin>TW</InteractionContactOrigin>
					<InteractionSourceObject>123123123123123</InteractionSourceObject>
					<InteractionSourceDataURL>https://twitter.com/Username1/status/123123123123123</InteractionSourceDataURL>
					<InteractionSourceTimeStampUTC>2018-07-19T13:19:30</InteractionSourceTimeStampUTC>
					<InteractionTimeStampUTC>2018-07-19T13:19:30</InteractionTimeStampUTC>
					<InteractionType>SOCIAL_POSTING</InteractionType>
					<InteractionTags>
						<InteractionTag>
							<InteractionTagUUID>00000000-0000-0000-0000-000000000000</InteractionTagUUID>
							<TagName>#SAP</TagName>
							<TagType>TWITTERSEARCH</TagType>
						</InteractionTag>
					</InteractionTags>
				</Interaction>
			</Interactions>
		</batchChangeSetPart>
		<batchChangeSetPart>
			<method>POST</method>
			<Interactions>
				<Interaction>
					<InteractionUUID>00000000-0000-0000-0000-000000000000</InteractionUUID>
					<InteractionContactId>1002914155756707840</InteractionContactId>
					<CommunicationMedium>TW</CommunicationMedium>
					<InteractionContent>Twitter tweet content</InteractionContent>
					<InteractionContentSubject>User Name: MediaFeedRT</InteractionContentSubject>
					<InteractionContactOrigin>TW</InteractionContactOrigin>
					<InteractionSourceObject>1313131313313131313</InteractionSourceObject>
					<InteractionSourceDataURL>https://twitter.com/MediaFeedRT/status/1313131313313131313</InteractionSourceDataURL>
					<InteractionSourceTimeStampUTC>2018-07-19T13:19:02</InteractionSourceTimeStampUTC>
					<InteractionTimeStampUTC>2018-07-19T13:19:02</InteractionTimeStampUTC>
					<InteractionType>SOCIAL_POSTING</InteractionType>
					<InteractionTags>
						<InteractionTag>
							<InteractionTagUUID>00000000-0000-0000-0000-000000000000</InteractionTagUUID>
							<TagName>#SAP</TagName>
							<TagType>TWITTERSEARCH</TagType>
						</InteractionTag>
					</InteractionTags>
				</Interaction>
			</Interactions>
		</batchChangeSetPart>
	</batchChangeSet>
</batchParts>

API_MKT_INTERACTION_SRV message received in SAP Marketing Cloud.

Inbound message for route 2 with the Interaction API (API_MKT_INTERACTION_SRV)

--batch
content-type: multipart/mixed; boundary=changeset_6a0c99c0-5522-42ad-832e-a25c9c86213d

--changeset_6a0c99c0-5522-42ad-832e-a25c9c86213d
content-type: application/http
content-transfer-encoding: binary

POST Interactions HTTP/1.1
Content-Length: 3205
Accept: application/atom+xml
Content-Type: application/atom+xml

<?xml version="1.0" encoding="utf-8"?>
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xml:base="https://<sap-marketing-cloud-host>/sap/opu/odata/sap/API_MKT_INTERACTION_SRV">
<id>https://<sap-marketing-cloud-host>/sap/opu/odata/sap/API_MKT_INTERACTION_SRVInteractions(guid'00000000-0000-0000-0000-000000000000')</id>
<title type="text">Interactions</title>
<updated>2018-08-14T13:18:24.024Z</updated>
<category term="API_MKT_INTERACTION_SRV.Interaction" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme">
</category>
<link href="Interactions(guid'00000000-0000-0000-0000-000000000000')" rel="edit" title="Interaction">
</link>
<link href="Interactions(guid'00000000-0000-0000-0000-000000000000')/InteractionTags" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/InteractionTags" title="InteractionTags" type="application/atom+xml;type=feed">
<m:inline>
<feed xml:base="https://<sap-marketing-cloud-host>/sap/opu/odata/sap/API_MKT_INTERACTION_SRV">
<id>https://<sap-marketing-cloud-host>/sap/opu/odata/sap/API_MKT_INTERACTION_SRVInteractionTags</id>
<title type="text">InteractionTags</title>
<updated>2018-08-14T13:18:24.024Z</updated>
<author>
<name>
</name>
</author>
<link href="InteractionTags" rel="self" title="InteractionTags">
</link>
<entry>
<id>https://<sap-marketing-cloud-host>/sap/opu/odata/sap/API_MKT_INTERACTION_SRVInteractionTags(guid'00000000-0000-0000-0000-000000000000')</id>
<title type="text">InteractionTags</title>
<updated>2018-08-14T13:18:24.024Z</updated>
<category term="API_MKT_INTERACTION_SRV.InteractionTag" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme">
</category>
<link href="InteractionTags(guid'00000000-0000-0000-0000-000000000000')" rel="edit" title="InteractionTag">
</link>
<content type="application/xml">
<m:properties>
<d:InteractionTagUUID>00000000-0000-0000-0000-000000000000</d:InteractionTagUUID>
<d:TagType>TWITTERSEARCH</d:TagType>
<d:TagName>#SAP</d:TagName>
</m:properties>
</content>
</entry>
</feed>
</m:inline>
</link>
<content type="application/xml">
<m:properties>
<d:InteractionUUID>00000000-0000-0000-0000-000000000000</d:InteractionUUID>
<d:InteractionContactOrigin>TW</d:InteractionContactOrigin>
<d:InteractionContactId>1934811111</d:InteractionContactId>
<d:CommunicationMedium>TW</d:CommunicationMedium>
<d:InteractionType>SOCIAL_POSTING</d:InteractionType>
<d:InteractionTimeStampUTC>2018-08-14T13:15:25.0000000Z</d:InteractionTimeStampUTC>
<d:InteractionSourceObject>1111111111111111111</d:InteractionSourceObject>
<d:InteractionSourceDataURL>https://twitter.com/twitteruser01/status/1111111111111111111</d:InteractionSourceDataURL>
<d:InteractionSourceTimeStampUTC>2018-08-14T13:15:25.0000000Z</d:InteractionSourceTimeStampUTC>
<d:InteractionContentSubject>User Name: twitteruser01</d:InteractionContentSubject>
<d:InteractionContent>RT @twitteruser0x: 1808 Release : Coming soon to the extensibility foundation for #SAP #SuccessFactors on SAP Cloud Platform https://t.co/0iPK…</d:InteractionContent>;
</m:properties>
</content>
</entry>

--changeset_6a0c99c0-5522-42ad-832e-a25c9c86213d
content-type: application/http
content-transfer-encoding: binary

POST Interactions HTTP/1.1
Content-Length: 3185
Accept: application/atom+xml
Content-Type: application/atom+xml

<?xml version="1.0" encoding="utf-8"?>
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xml:base="https://<sap-marketing-cloud-host>/sap/opu/odata/sap/API_MKT_INTERACTION_SRV">
<id>https://<sap-marketing-cloud-host>/sap/opu/odata/sap/API_MKT_INTERACTION_SRVInteractions(guid'00000000-0000-0000-0000-000000000000')</id>
<title type="text">Interactions</title>
<updated>2018-08-14T13:18:24.025Z</updated>
<category term="API_MKT_INTERACTION_SRV.Interaction" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme">
</category>
<link href="Interactions(guid'00000000-0000-0000-0000-000000000000')" rel="edit" title="Interaction">
</link>
<link href="Interactions(guid'00000000-0000-0000-0000-000000000000')/InteractionTags" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/InteractionTags" title="InteractionTags" type="application/atom+xml;type=feed">
<m:inline>
<feed xml:base="https://<sap-marketing-cloud-host>/sap/opu/odata/sap/API_MKT_INTERACTION_SRV">
<id>https://<sap-marketing-cloud-host>/sap/opu/odata/sap/API_MKT_INTERACTION_SRVInteractionTags</id>
<title type="text">InteractionTags</title>
<updated>2018-08-14T13:18:24.025Z</updated>
<author>
<name>
</name>
</author>
<link href="InteractionTags" rel="self" title="InteractionTags">
</link>
<entry>
<id>https://<sap-marketing-cloud-host>/sap/opu/odata/sap/API_MKT_INTERACTION_SRVInteractionTags(guid'00000000-0000-0000-0000-000000000000')</id>
<title type="text">InteractionTags</title>
<updated>2018-08-14T13:18:24.025Z</updated>
<category term="API_MKT_INTERACTION_SRV.InteractionTag" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme">
</category>
<link href="InteractionTags(guid'00000000-0000-0000-0000-000000000000')" rel="edit" title="InteractionTag">
</link>
<content type="application/xml">
<m:properties>
<d:InteractionTagUUID>00000000-0000-0000-0000-000000000000</d:InteractionTagUUID>
<d:TagType>TWITTERSEARCH</d:TagType>
<d:TagName>#SAP</d:TagName>
</m:properties>
</content>
</entry>
</feed>
</m:inline>
</link>
<content type="application/xml">
<m:properties>
<d:InteractionUUID>00000000-0000-0000-0000-000000000000</d:InteractionUUID>
<d:InteractionContactOrigin>TW</d:InteractionContactOrigin>
<d:InteractionContactId>222222222</d:InteractionContactId>
<d:CommunicationMedium>TW</d:CommunicationMedium>
<d:InteractionType>SOCIAL_POSTING</d:InteractionType>
<d:InteractionTimeStampUTC>2018-08-14T13:13:00.0000000Z</d:InteractionTimeStampUTC>
<d:InteractionSourceObject>2233333333331111111</d:InteractionSourceObject>
<d:InteractionSourceDataURL>https://twitter.com/twitteruser0x/status/2233333333331111111</d:InteractionSourceDataURL>
<d:InteractionSourceTimeStampUTC>2018-08-14T13:13:00.0000000Z</d:InteractionSourceTimeStampUTC>
<d:InteractionContentSubject>User Name: twitteruser0x</d:InteractionContentSubject>
<d:InteractionContent>1808 Release : Coming soon to the extensibility foundation for #SAP #SuccessFactors on SAP Cloud Platform… https://t.co/KVwFQlbw6M</d:InteractionContent>;
</m:properties>
</content>
</entry>

--changeset_6a0c99c0-5522-42ad-832e-a25c9c86213d
content-type: application/http
content-transfer-encoding: binary

--changeset_6a0c99c0-5522-42ad-832e-a25c9c86213d--
--batch--

 

With this example scenario you should be able to build your own scenario to create interactions including sub-entities to SAP Marketing Cloud.

Next, we will create a scenario to create and update interactions and interaction sub-entities.

Part 2: Create and update integrations in SAP Marketing Cloud

You want to see more articles from SAP Services? Click on the banner below.

Your SAP CX Services – Marketing Practice team.

Sara Sampaio

Sara Sampaio

Author Since: March 10, 2022

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x