Salesforce Marketing Cloud Writer
The Salesforce Marketing Cloud Writer enables you to write data directly to the Salesforce Marketing Cloud Engagement B2C platform in Salesforce using REST or SOAP API calls.
The Salesforce Marketing Cloud Writer supports OAuth authentication exclusively.
Summary
APIs used/data supported | Salesforce REST and SOAP APIs. |
Supported sources | All sources that emit WAEvents. |
Security and authentication | OAuth 2.0 |
Operations / modes supported | Append-only and Merge modes. |
Resilience / recovery | Configurable automatic retries |
Performance | Striim Platform supported parallel execution |
Programmability |
|
Metrics and auditing | Key metrics available through Striim monitoring |
Key limitations | Most objects have |
Salesforce Marketing Cloud Writer properties
Name | Type | Default | Description |
---|---|---|---|
API type | Select list
| SOAP | The tables supported by each type of API are listed later in this document. |
Application error count threshold | Integer | 0 | The app halts when the number of ignorable exceptions exceeds the value specified in this property. |
Batch policy | Text | eventCount:10000, Interval:300 | The Striim server buffers events locally and sends batches to the target when the buffer contains the amount of events specified by the Set the |
Client ID | Text | The Client ID of the app using OAuth. | |
Client secret | Password |
| Client secret for the app using OAuth. |
Connection retry policy | Text | retryinterval=30, maxRetries=3 | With the default setting, if a connection attempt is unsuccessful, the adapter will try again in 30 seconds ( |
Ignorable exceptions | Text | A comma-separated list of exceptions that are ignored while the total number is below a specified threshold. | |
Mode | Select list | MERGE | In MERGE mode, inserts, updates, and deletes in the source are handled as inserts, updates, and deletes in the target. NoteThe columnmap(EmailAddress=subject,SubscriberKey=id) KeyColumns(SubscriberKey) Known issue DEV-49140: APPENDONLY mode is not supported in this release. |
OAuth grant type | Select list
| Client | The type of grant used with OAuth. See Salesforce documentation for further details on grant types. |
Parallel threads | Integer | 0 | Enables the creation of multiple writer instances, up to the specified number. |
Refresh token | Password | The OAuth refresh token. This property is only used with Code-type OAuth grants. | |
SubDomain | String | The subdomain used by the Salesforce Marketing Cloud API. | |
Tables | String | Specifies a list of table objects delimited by the semicolon ( Writes to multiple objects are supported when the source is a database reader, incremental batch reader, or SQL CDC reader. To perform writes to multiple objects, specify the names of the source and target objects. When the source uses three-part names, use the three-part format to specify that object. NoteTable names from an SQL Server source requires the three-part format when the source is a database or incremental batch reader, but require the two-part format when the source is an MS SQL or MS Jet reader. |
Table objects that support the Salesforce REST API
Table name | Create, update, delete support | Description |
---|---|---|
CUD | Contains assets from the Salesforce Marketing Cloud account associated with this Striim app. | |
CUD | Contains event notification callbacks. | |
CUD | Contains information about campaigns. | |
CUD | Contains the folders in the Content Builder. | |
CD | Contains event definitions. | |
C | Contains properties used by Facebook Messenger. | |
CU | Contains journey activities. | |
CUD | Contains journeys. | |
C | Contains properties used by Line Messenger. | |
CUD | Contains send definitions. | |
CUD | Contains event notification subscriptions. |
Table objects that support the Salesforce SOAP API
Table name | Description |
---|---|
A Marketing Cloud Engagement account. | |
The username of an individual user within an account. This table does not support delete operations. | |
A unit within an Enterprise or Enterprise 2.0 account. This table supports queries and updates only. | |
A defined section of reusable content. | |
A data extension within an account. | |
An email in a Marketing Cloud Engagement account. | |
The message information, sender profile, deliver profile, and audience information. | |
Reserved for future use. Does not support delete operations. | |
An audience based on specified rules in a filter. Does not support insert operations. | |
A reusable pattern of import options. Does not support insert operations. | |
A marketing list of subscribers. | |
A file within the portfolio of a Marketing Cloud Engagement account. | |
Reserved for future use. Does not support delete or insert operations. | |
A SQL query meant to be accessed with and performed by the SOAP API. This table does not support update or insert operations. | |
Configuration settings for the reply mail management for an account. Does not support delete operations. | |
Sends email and retrieves aggregate data. Does not support delete or update operations. | |
A send classification in a Marketing Cloud Engagement account. | |
The send profile used in conjunction with an email send definition. | |
A single instance of an SMS triggered send. Does not support delete or update operations. | |
A subscription to receive email or SMS communications. | |
A suppression list that can be used with different contexts. | |
Creating or updating a triggered send definition with the list ID as the All Subs list ID requires the following permissions:
|
Configuring OAuth for the Code grant type
Use the Code grant for web app integrations. Before you begin, confirm that you have access to a Salesforce Marketing Cloud Engagement account.
Log in to the Salesforce Marketing Cloud Engagement account.
Navigate to Setup.
In the App section, install any required packages.
See "Set up your development environment for legacy packages" for details.
Create a web app integration app.
Note the following values:
Client ID
Client secret
Redirect URL
In a web browser, navigate to the following URL.
https://<YOUR_DOMAIN>/v2/authorize?response_type=code&client_id=<client_id>&redirect_uri=<redirect_url>&state=mystate
Replace the placeholder information in brackets (
<>
) with the pertinent values. This API call returns a JSON object with values used later in this procedure.Make the following POST request.
https://YOUR_SUBDOMAIN.auth.marketingcloudapis.com POST /v2/token Content-Type: application/json { "grant_type":"authorization_code", "code":"<code>", "client_id":"<client_id>", "client_secret":"<client_secret>", "redirect_uri":"<redirect_url>" }
Replace the placeholder information in brackets (
<>
) with the information from the JSON object returned earlier in this procedure. This POST request returns a refresh token.Open the Striim Flow Designer.
In the Flow Designer, navigate to the configuration for the Salesforce Marketing Cloud writer and select Code as the grant type.
Type the values of the Client ID, Client secret, and refresh token in the corresponding fields.
Configuring OAuth for the Client grant type
Use the Client grant for server-to-server integrations. Before you begin, confirm that you have access to a Salesforce Marketing Cloud Engagement account.
Log in to the Salesforce Marketing Cloud Engagement account.
Navigate to Setup.
In the App section, install any required packages.
See "Set up your development environment for legacy packages" for details.
Create a server-server integration app.
Note the following values:
Client ID
Client secret
REST base URI
SOAP base URI
In the Subdomain field, type the domain of the base URIs noted in the previous step.
Open the Striim Flow Designer.
In the Flow Designer, navigate to the configuration for the Salesforce Marketing Cloud writer and select CLIENT as the grant type.
Type the values of the Client ID and Client secret in the corresponding fields.
Sample TQL for Salesforce Marketing Cloud Writer
The following TQL reads records from a MySQL instance and loads them into Salesforce Marketing Cloud Engagement.
CREATE OR REPLACE SOURCE src USING MysqlReader ( ConnectionURL: 'mysql://localhost:3306', compression: false, Tables: 'waction.test', Password: 'w@ct10n', sendBeforeImage: true, Username: 'root' ) OUTPUT TO MySQLTestStream; CREATE OR REPLACE TARGET test USING SysOut ( name: 'test' ) INPUT FROM MySQLTestStream; CREATE OR REPLACE TARGET sfm2 USING Global.SalesforceMarketingCloudWriter ( ParallelThreads: '', Tables: 'waction.test,Subscriber columnmap(EmailAddress=subject,SubscriberKey=Id)', ApiType: 'SOAP', BatchPolicy: 'eventCount:1000, Interval:60', ClientSecret: 'e8cA4xYBMfwc7B1pCRmRNjve', Mode: 'APPENDONLY', ClientId: 'x5r8h110cnmklfmu8liussbd', GrantType: 'CLIENT', SubDomain: 'mcrt05fjv-vlf65zcn6pb56n8xd4', IgnorableException: '', connectionRetryPolicy: 'retryInterval=30, maxRetries=3', ApplicationErrorCountThreshold: '0' ) INPUT FROM MySQLTestStream; END APPLICATION MySQLTest;