Establishing a Connection
This section describes how to connect to Salesforce Marketing Cloud from your AnyPoint Studio project. You can use wizards or the XML editor in AnyPoint Studio to define connection properties in a global element. Global elements can be reused across other building blocks in your project.
Create a Connection in the Visual Editor
Complete the following steps to visually add the connector to your project and create a connection:
- Create a new Mule Project in Anypoint Studio.
- From the palette, drag the connector into your Mule flow.
- On the Message Flow canvas, double-click the connector icon to open the connector properties in the Properties pane.
- In the General section, click Add and define the Salesforce Marketing Cloud connection properties. Note that the user name and Password properties always appear here. The user name must be set as it is used as the key for the connection if connection pooling is enabled.
Create a Connection in the XML Editor
Set connection properties in the <cdata-sfmarketingcloud:config> element in the root of the project's XML.
Note: The user name attribute must always be included here and serves as the key for the connection if connection pooling is enabled.
<cdata-sfmarketingcloud:config name="CData_SFMarketingCloud_Configuration" username="MyName" connectionProperty1="MyProperty" ... doc:name="CData SFMarketingCloud: Configuration"/>
Authenticating to the Salesforce Marketing Cloud REST API
To connect, set Schema to "REST". The Salesforce Marketing Cloud REST API uses the OAuth authentication standard. To authenticate using OAuth, you will need to create an app to obtain the OAuthClientId and OAuthClientSecret connection properties. See Using OAuth Authentication for an authentication guide.
Authenticating to the Salesforce Marketing Cloud SOAP API
The Salesforce Marketing Cloud SOAP API can connect using either your login credentials, or Using OAuth Authentication.
To connect to data using basic (login credentials) authentication, set the following:
- User: The Salesforce Marketing Cloud user account used to authenticate.
- Password: The password used to authenticate the user.
to your login credentials.
Connecting to the Salesforce Marketing Cloud APIs
Once you have authenticated to either the SOAP or REST API, you are ready to connect to data.
You may optionally refine data access using the following properties:
- Instance: The instance of the Salesforce Marketing Cloud API used. The default Instance is s7 of the Web Services API; however, you can use this property to specify a different instance.
Configure Connector Operations
The connector is an operation-based connector; its operations correspond to SQL statements and expose other functionality such as Schema Discovery. See Using the Connector (Mule 3.8+) for more information on executing SQL to Salesforce Marketing Cloud in Mule applications.