Skip to main content

Striim Platform 5.0 documentation

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

  • Striim Wizard

  • Striim Flow Designer

  • Striim TQL

Metrics and auditing

Key metrics available through Striim monitoring

Key limitations

Most objects have autogenerated as the value for the ID field. Update operations sent by the source are treated as Insert operations at the target.

Salesforce Marketing Cloud Writer properties

Name

Type

Default

Description

API type

Select list

  • REST

  • SOAP

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 eventCount field, or the number of seconds specified by the Interval field have elapsed. When the app halts, any unsent events that are in the buffer are discarded.

Set the eventCount field to 1 and Interval to 0 to disable batching.

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 (retryInterval. If the second attempt is unsuccessful, in 30 seconds it will try a third time (maxRetries). If that is unsuccessful, the adapter will fail and log an exception. Negative values are not supported.

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.

Note

The DELETE operation cannot be converted to “Insert” in MERGE mode. For this scenario the Subscriber table doesn't have any KeyColumns hence all combination of columns is taken as Keycolumns hence “Delete” doesn’t work. Overriding the KeyColumns in the ColumnMap will fix this issue.

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

  • Code

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 (;) character. The Salesforce Marketing Cloud writer writes to the specified table objects. The table objects must exist when the application starts. Object names support wildcards, but not partial wildcards. Object and field names are case insensitive.

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.

Note

Table 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

Assets

CUD

Contains assets from the Salesforce Marketing Cloud account associated with this Striim app.

Callbacks

CUD

Contains event notification callbacks.

Campaigns

CUD

Contains information about campaigns.

Categories

CUD

Contains the folders in the Content Builder.

EventDefinitions

CD

Contains event definitions.

FacebookMessengerProperties

C

Contains properties used by Facebook Messenger.

JourneyActivities

CU

Contains journey activities.

Journeys

CUD

Contains journeys.

LineMessengerProperties

C

Contains properties used by Line Messenger.

SendDefinitions

CUD

Contains send definitions.

Subscriptions

CUD

Contains event notification subscriptions.

Table objects that support the Salesforce SOAP API

Table name

Description

Account

A Marketing Cloud Engagement account.

AccountUser

The username of an individual user within an account. This table does not support delete operations.

BusinessUnit

A unit within an Enterprise or Enterprise 2.0 account. This table supports queries and updates only.

ContentArea

A defined section of reusable content.

DataExtension

A data extension within an account.

Email

An email in a Marketing Cloud Engagement account.

EmailSendDefinition

The message information, sender profile, deliver profile, and audience information.

FileTrigger

Reserved for future use. Does not support delete operations.

FileDefinition

An audience based on specified rules in a filter. Does not support insert operations.

ImportDefinition

A reusable pattern of import options. Does not support insert operations.

List

A marketing list of subscribers.

Portfolio

A file within the portfolio of a Marketing Cloud Engagement account.

ProgramManifestTemplate

Reserved for future use. Does not support delete or insert operations.

QueryDefinition

A SQL query meant to be accessed with and performed by the SOAP API. This table does not support update or insert operations.

ReplyMailManagementConfiguration

Configuration settings for the reply mail management for an account. Does not support delete operations.

Send

Sends email and retrieves aggregate data. Does not support delete or update operations.

SendClassification

A send classification in a Marketing Cloud Engagement account.

SenderProfile

The send profile used in conjunction with an email send definition.

SMSTriggeredSend

A single instance of an SMS triggered send. Does not support delete or update operations.

Subscriber

A subscription to receive email or SMS communications.

SuppressionListDefinition

A suppression list that can be used with different contexts.

TriggeredSendDefinition

Creating or updating a triggered send definition with the list ID as the All Subs list ID requires the following permissions:

  • Email | Subscribers | All Subscribers | View

  • SendEmailToList

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.

  1. Log in to the Salesforce Marketing Cloud Engagement account.

  2. Navigate to Setup.

  3. In the App section, install any required packages.

    See "Set up your development environment for legacy packages" for details.

  4. Create a web app integration app.

  5. Note the following values:

    • Client ID

    • Client secret

    • Redirect URL

  6. 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.

  7. 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.

  8. Open the Striim Flow Designer.

  9. In the Flow Designer, navigate to the configuration for the Salesforce Marketing Cloud writer and select Code as the grant type.

  10. 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.

  1. Log in to the Salesforce Marketing Cloud Engagement account.

  2. Navigate to Setup.

  3. In the App section, install any required packages.

    See "Set up your development environment for legacy packages" for details.

  4. Create a server-server integration app.

  5. Note the following values:

    • Client ID

    • Client secret

    • REST base URI

    • SOAP base URI

  6. In the Subdomain field, type the domain of the base URIs noted in the previous step.

  7. Open the Striim Flow Designer.

  8. In the Flow Designer, navigate to the configuration for the Salesforce Marketing Cloud writer and select CLIENT as the grant type.

  9. 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;