Salesforce Marketing Cloud

The Salesforce Marketing Cloud connector lets you perform insert, delete, update, and read operations on a Salesforce Marketing Cloud dataset.

Before you begin

Before using the Salesforce Marketing Cloud connector, do the following tasks:

  • In your Google Cloud project:
    • Ensure that network connectivity is set up. For information about network patterns, see Network connectivity.
    • Grant the roles/connectors.admin IAM role to the user configuring the connector.
    • Grant the following IAM roles to the service account that you want to use for the connector:
      • roles/secretmanager.viewer
      • roles/secretmanager.secretAccessor

      A service account is a special type of Google account intended to represent a non-human user that needs to authenticate and be authorized to access data in Google APIs. If you don't have a service account, you must create a service account. For more information, see Creating a service account.

    • Enable the following services:
      • secretmanager.googleapis.com (Secret Manager API)
      • connectors.googleapis.com (Connectors API)

      To understand how to enable services, see Enabling services.

    If these services or permissions have not been enabled for your project previously, you are prompted to enable them when configuring the connector.

Configure the connector

Configuring the connector requires you to create a connection to your data source (backend system). A connection is specific to a data source. It means that if you have many data sources, you must create a separate connection for each data source. To create a connection, do the following steps:

  1. In the Cloud console, go to the Integration Connectors > Connections page and then select or create a Google Cloud project.

    Go to the Connections page

  2. Click + CREATE NEW to open the Create Connection page.
  3. In the Location section, choose the location for the connection.
    1. Region: Select a location from the drop-down list.

      For the list of all the supported regions, see Locations.

    2. Click NEXT.
  4. In the Connection Details section, complete the following:
    1. Connector: Select Salesforce Marketing Cloud from the drop down list of available Connectors.
    2. Connector version: Select the Connector version from the drop down list of available versions.
    3. In the Connection Name field, enter a name for the Connection instance.

      Connection names must meet the following criteria:

      • Connection names can use letters, numbers, or hyphens.
      • Letters must be lower-case.
      • Connection names must begin with a letter and end with a letter or number.
      • Connection names cannot exceed 49 characters.
    4. Optionally, enter a Description for the connection instance.
    5. Optionally, enable Cloud logging, and then select a log level. By default, the log level is set to Error.
    6. Service Account: Select a service account that has the required roles.
    7. Optionally, configure the Connection node settings:

      • Minimum number of nodes: Enter the minimum number of connection nodes.
      • Maximum number of nodes: Enter the maximum number of connection nodes.

      A node is a unit (or replica) of a connection that processes transactions. More nodes are required to process more transactions for a connection and conversely, fewer nodes are required to process fewer transactions. To understand how the nodes affect your connector pricing, see Pricing for connection nodes. If you don't enter any values, by default the minimum nodes are set to 2 (for better availability) and the maximum nodes are set to 50.

    8. API Integration Type: The grant type for the OAuth flow. Accepted entries are Server-to-Server and Web-App.
    9. Account Id: The account identifier, or MID, of the target business unit.
    10. Display Child Data Extensions: Displays the Data Extensions of Child Accounts if set.
    11. Instance: The instance of the Salesforce Marketing Cloud API used.
    12. List Data Extensions: A boolean determining if data extensions should be listed as tables or not.
    13. Query All Accounts: Queries all accounts, including parent and all children, regarding an event.
    14. Schema: Specify the Salesforce Marketing Cloud server version to connect with.
    15. Subdomain: The subdomain of the Salesforce Marketing Cloud API.
    16. Use Legacy Authentication: A boolean determining if the connection should be made to Salesforce Marketing Cloud REST API using the legacy authentication or not.
    17. Use proxy: Select this checkbox to configure a proxy server for the connection and configure the following values:
      • Proxy Auth Scheme: Select the authentication type to authenticate with the proxy server. The following authentication types are supported:
        • Basic: Basic HTTP authentication.
        • Digest: Digest HTTP authentication.
      • Proxy User: A user name to be used to authenticate with the proxy server.
      • Proxy Password: The Secret manager secret of the user's password.
      • Proxy SSL Type: The SSL type to use when connecting to the proxy server. The following authentication types are supported:
        • Auto: Default setting. If the URL is an HTTPS URL, then the Tunnel option is used. If the URL is an HTTP URL, then the NEVER option is used.
        • Always: The connection is always SSL enabled.
        • Never: The connection is not SSL enabled.
        • Tunnel: The connection is through a tunneling proxy. The proxy server opens a connection to the remote host and traffic flows back and forth through the proxy.
      • In the Proxy Server section, enter details of the proxy server.
        1. Click + Add destination.
        2. Select a Destination Type.
          • Host address: Specify the hostname or IP address of the destination.

            If you want to establish a private connection to your backend system, do the following:

    18. Optionally, click + ADD LABEL to add a label to the Connection in the form of a key/value pair.
    19. Click NEXT.
  5. In the Authentication section, enter the authentication details.
    1. Select an Authentication type and enter the relevant details.

      The following authentication types are supported by the Salesforce Marketing Cloud connection:

      • Username and password
    2. To understand how to configure these authentication types, see Configure authentication.

    3. Click NEXT.
  6. Review: Review your connection and authentication details.
  7. Click Create.

Configure authentication

Enter the details based on the authentication you want to use.

  • Username and password
    • Username: Username for connector
    • Password: Secret Manager Secret containing the password associated with the connector.

Entities, operations, and actions

All the Integration Connectors provide a layer of abstraction for the objects of the connected application. You can access an application's objects only through this abstraction. The abstraction is exposed to you as entities, operations, and actions.

  • Entity: An entity can be thought of as an object, or a collection of properties, in the connected application or service. The definition of an entity differs from a connector to a connector. For example, in a database connector, tables are the entities, in a file server connector, folders are the entities, and in a messaging system connector, queues are the entities.

    However, it is possible that a connector doesn't support or have any entities, in which case the Entities list will be empty.

  • Operation: An operation is the activity that you can perform on an entity. You can perform any of the following operations on an entity:

    Selecting an entity from the available list, generates a list of operations available for the entity. For a detailed description of the operations, see the Connectors task's entity operations. However, if a connector doesn't support any of the entity operations, such unsupported operations aren't listed in the Operations list.

  • Action: An action is a first class function that is made available to the integration through the connector interface. An action lets you make changes to an entity or entities, and vary from connector to connector. Normally, an action will have some input parameters, and an output parameter. However, it is possible that a connector doesn't support any action, in which case the Actions list will be empty.

System limitations

The Salesforce Marketing Cloud connector can process a maximum of 7 transactions per second, per node, and throttles any transactions beyond this limit. By default, Integration Connectors allocates 2 nodes (for better availability) for a connection.

For information on the limits applicable to Integration Connectors, see Limits.

Actions

This section lists all the actions supported by the Salesforce Marketing Cloud connection.

GetJourneyPublicationStatus action

This action gets the status of a journey publication.

Input parameters of the GetJourneyPublicationStatus action

Parameter Name Data Type Required Description
StatusId string True The status ID of a journey publication.

Output parameters of the GetJourneyPublicationStatus action

This action returns the status 200 (OK) with a response body indicating all results.

For example on how to configure the GetJourneyPublicationStatus action, see Examples.

FireEntryEvent action

Fire the entry event that initiates the journey.

Input parameters of the FireEntryEvent action

Parameter Name Data Type Required Description
ContactKey String True The ID that uniquely identifies a subscriber or contact
EventDefinitionKey String True Find the EventDefinitionKey in Event Administration after the event is created and saved. This is true for both standard and custom events. Don't include a period in the event definition key.
Data String False Properties of the event. Only required if defined in a custom event or by the event.

Output parameters of the FireEntryEvent action

This action returns the status 200 (OK) with a response body indicating all results

For example on how to configure the FireEntryEvent action, see Examples.

StopJourney action

Stops a running journey

Input parameters of the StopJourney action

Parameter Name Data Type Required Description
JourneyId String True The ID of the journey to stop, expressed in the form of a GUID (UUID)
JourneyVersion Integer True The version number of the journey to stop

Output parameters of the StopJourney action

This action returns the status 200 (OK) with a response body indicating all results

For example on how to configure the StopJourney action, see Examples.

PublishJourney action

PublishJourney Action Publishes a journey version asynchronously

Input parameters of the PublishJourney action

Parameter Name Data Type Required Description
JourneyId String True The ID of the journey to stop, expressed in the form of a GUID (UUID).
JourneyVersion Integer True The version number of the journey to stop.

Output parameters of the PublishJourney action

This action returns the status 200 (OK) with a response body indicating all results

For example on how to configure the PublishJourney action, see Examples.

CreateTriggeredSend action

CreateTriggeredSend Action Creates a triggered send object which represents a specific instance of a triggered email send

Input parameters of the CreateTriggeredSend action

Parameter Name Data Type Required Description
Key String False Defines associated triggered send definition for triggered send. This property corresponds to the external key assigned to an object in Marketing Cloud.
SendId String False ID of the entry event send definition that comes from the response when creating a TriggeredSendDefinition. Either this or the external key is required.
FromAddress String False Email address that will show as the sender.
FromName String False Name of the sender
ToAddress String True Email address of the message recipient.
SubscriberKey String True Unique identifier defined for the message recipient.
SubscriberAttributes String False Name and value pairs for subscriber attributes defined for the message.
RequestType String False Valid values ASYNC and SYNC. Default value when not defined is ASYNC. Determines if the request is processed asynchronously.

Output parameters of the CreateTriggeredSend action

This action returns the status 200 (OK) with a response body indicating all results

For example on how to configure the CreateTriggeredSend action, see Examples.

SendTransactionalMessageToRecipient action

SendTransactionalMessageToRecipient Action Sends a message to a single recipient via a send definition

Input parameters of the SendTransactionalMessageToRecipient action

Parameter Name Data Type Required Description
MessageKey String True User-defined message identifier.
DefinitionKey String True Unique identifier of the definition.
RecipientContactKey String True Unique identifier for a subscriber in Marketing Cloud. Each request must include a contactKey. You can use an existing subscriber key or create one at send time by using the recipient's email address
RecipientTo String False Channel address of the recipient. For email, it's the recipient's email address
Attributes String False Information used to personalize the message for the recipient. Written as key pairs. The attributes match profile attributes, content attributes, or triggered send data extension attributes

Output parameters of the SendTransactionalMessageToRecipient action

This action returns the status 200 (OK) with a response body indicating all results

For example on how to configure the SendTransactionalMessageToRecipient action, see Examples.

Examples

This section describes how to perform some of the entity operations and actions in this connector.

Example - Get the status of a journey publication

  1. In the Configure connector task dialog, click Actions.
  2. Select the GetJourneyPublicationStatus action, and then click Done.
  3. In the Task Input section of the Connectors task, click connectorInputPayload and then enter a value similar to the following in the Default Value field:
    {
      "StatusId": "3acf1f54-5c9e-4719-b7f7-bfc2e5caf10a"
    }
  4. If the action is successful, the connector task's connectorOutputPayload field will have a value similar to the following:

     [{
      "Status": "PublishCompleted",
      "Message": null
    }] 

Example - Fire an entry event to initiate a journey

  1. In the Configure connector task dialog, click Actions.
  2. Select the FireEntryEvent action, and then click Done.
  3. In the Task Input section of the Connectors task, click connectorInputPayload and then enter a value similar to the following in the Default Value field:
    {
      "ContactKey": "Email",
      "EventDefinitionKey": "APIEvent-4d84e619-a629-6b17-945f-9a6e78a1982c",
      "Data": "{\"Email\": \"usr1@test.com\"}"
    }
  4. If the action is successful, the connector task's connectorOutputPayload field will have a value similar to the following:

     [{
      "EventInstanceId": "0d6f6dd1-1aaa-4eec-9727-f99550ab68f9"
    }]

Example - Stop a running journey

  1. In the Configure connector task dialog, click Actions.
  2. Select the StopJourney action, and then click Done.
  3. In the Task Input section of the Connectors task, click connectorInputPayload and then enter a value similar to the following in the Default Value field:
    {
      "JourneyId": "37D2789E-2B1D-433E-8E18-8F47E4D8E865",
      "JourneyVersion": 1.0
    }
  4. If the action is successful, the connector task's connectorOutputPayload field will have a value similar to the following:

      [{
      "Success": true
    }] 

Example - Publish a journey version

  1. In the Configure connector task dialog, click Actions.
  2. Select the PublishJourney action, and then click Done.
  3. In the Task Input section of the Connectors task, click connectorInputPayload and then enter a value similar to the following in the Default Value field:
    {
      "JourneyId": "0868BF36-3107-460E-9EF1-09633A0592E8",
      "JourneyVersion": 1.0
    }
  4. If the action is successful, the connector task's connectorOutputPayload field will have a value similar to the following:

     [{
      "StatusId": "acb1734d-483e-400a-97d7-0501b94f03b2"
    }]  

Example - Create a trigger to initiate a journey

  1. In the Configure connector task dialog, click Actions.
  2. Select the CreateTriggeredSend action, and then click Done.
  3. In the Task Input section of the Connectors task, click connectorInputPayload and then enter a value similar to the following in the Default Value field:
    {
      "Key": "BU27_SendDefinition1",
      "ToAddress": "usr1@test.com",
      "SubscriberKey": "107",
      "SubscriberAttributes": "{\"FirstName\": \"John\", \"LastName\": \"P\"}"
    }
  4. If the action is successful, the connector task's connectorOutputPayload field will have a value similar to the following:

     [{
      "Success": "True",
      "RecipientSendId": "5d06edb1-d07c-48ad-a1f2-d6350eb863f8",
      "Messages": "Queued"
    }]  

Example - Send a message to a single recipient

  1. In the Configure connector task dialog, click Actions.
  2. Select the SendTransactionalMessageToRecipient action, and then click Done.
  3. In the Task Input section of the Connectors task, click connectorInputPayload and then enter a value similar to the following in the Default Value field:
    {
      "MessageKey": "T9999009",
      "DefinitionKey": "Send-Definition-SFMC-Demo-2",
      "RecipientContactKey": "107",
      "RecipientTo": "usr1@test.com",
      "Attributes": "FirstName :John"
    }
  4. If the action is successful, the connector task's connectorOutputPayload field will have a value similar to the following:

    [{
      "RequestId": "d8fb9e9e-3ae2-412f-b01e-d198433cfc16"
    }] 

Example - List records in an entity

This example lists the records in the Assets entity.

  1. In the Configure connector task dialog, click Entities.
  2. Select Assets from the Entity list.
  3. Select the LIST operation, and then click Done.
  4. In the Task Input section of the Connectors task, you can set the filterClause as per your requirement.

    For example, setting the filter clause to Location='US' and region='us-east1', lists only those records in the US location whose region is us-east1.

Example - Get a record from an entity

This example fetches a single record from the Assets entity.

  1. In the Configure connector task dialog, click Entities.
  2. Select Assets from the Entity list.
  3. Select the GET operation, and then click Done.
  4. In the Task Input section of the Connectors task, click EntityId and then enter 49851 in the Default Value field.

    Here, 49851 is the primary key of the Assets entity.

Example - Delete a record from an entity

This example deletes a record from the Assets entity.

  1. In the Configure connector task dialog, click Entities.
  2. Select Assets from the Entity list.
  3. Select the DELETE operation, and then click Done.
  4. In the Task Input section of the Connectors task, click entityId and then enter 49851 in the Default Value field.

Example - Create a record in an entity

This example creates a record in the DataExtensionObject_Custom entity.

  1. In the Configure connector task dialog, click Entities.
  2. Select DataExtensionObject_Custom from the Entity list.
  3. Select the Create operation, and then click Done.
  4. In the Task Input section of the Connectors task, click connectorInputPayload and then enter a value similar to the following in the Default Value field:
    {
        "StudentName":"John",
        "StudentID":"1",
        "Rank":"1"}

    If the integration is successful, the connector task's connectorOutputPayload field will have a value similar to the following:

     {
          "StudentID": 1
        } 

Example - Update a record in an entity

This example updates a record in the Journeys entity.

  1. In the Configure connector task dialog, click Entities.
  2. Select Journeys from the Entity list.
  3. Select the Update operation, and then click Done.
  4. In the Task Input section of the Connectors task, click connectorInputPayload and then enter a value similar to the following in the Default Value field:
    {
      "Name": "SFMC_CRETAE_JOURNEY_V1"
    }
  5. Set the entity ID to the entity of the Journeys . To set the entity ID, click entityId and then enter 0868BF36-3107-460E-9EF1-09633A0592E8 in the Default Value field.

    If the integration is successful, the connector task's connectorOutputPayload field will have a value similar to the following:

    {
      "Id": "0868bf36-3107-460e-9ef1-09633a0592e8"
    }

Use terraform to create connections

You can use the Terraform resource to create a new connection.

To learn how to apply or remove a Terraform configuration, see Basic Terraform commands.

To view a sample terraform template for connection creation, see sample template.

When creating this connection by using Terraform, you must set the following variables in your Terraform configuration file:

Parameter name Data type Required Description
apiintegration_type ENUM False The grant type for the OAuth flow. Accepted entries are Server-to-Server and Web-App. Supported values are: Server-to-Server, Web-App
schema ENUM True Specify the Salesforce Marketing Cloud APIs to connect with. Supported values are: REST, SOAP
account_id STRING False The account identifier, or MID, of the target business unit.
display_child_data_extensions BOOLEAN False Displays the Data Extensions of Child Accounts if set.
instance STRING False The instance of the Salesforce Marketing Cloud API used. Note: If the instance is greater than s10, then Subdomain must be specified.
list_data_extensions BOOLEAN False A boolean determining if data extensions should be listed as tables or not.
query_all_accounts BOOLEAN False Queries all accounts, including parent and all children, regarding an event.
verbosity STRING False Verbosity level for connection, varies from 1-5. Higher verbosity level will log all the communication details (request,response & ssl certificates).
subdomain STRING False The subdomain of the Salesforce Marketing Cloud API.
proxy_enabled BOOLEAN False Select this checkbox to configure a proxy server for the connection.
proxy_auth_scheme ENUM False The authentication type to use to authenticate to the ProxyServer proxy. Supported values are: BASIC, DIGEST, NONE
proxy_user STRING False A user name to be used to authenticate to the ProxyServer proxy.
proxy_password SECRET False A password to be used to authenticate to the ProxyServer proxy.
proxy_ssltype ENUM False The SSL type to use when connecting to the ProxyServer proxy. Supported values are: AUTO, ALWAYS, NEVER, TUNNEL

Use the Salesforce Marketing Cloud connection in an integration

After you create the connection, it becomes available in both Apigee Integration and Application Integration. You can use the connection in an integration through the Connectors task.

  • To understand how to create and use the Connectors task in Apigee Integration, see Connectors task.
  • To understand how to create and use the Connectors task in Application Integration, see Connectors task.

Get help from the Google Cloud community

You can post your questions and discuss this connector in the Google Cloud community at Cloud Forums.

What's next