Establishing a Connection
This section describes how to connect to Salesforce Pardot 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 Pardot 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-salesforcepardot: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-salesforcepardot:config name="CData_SalesforcePardot_Configuration" username="MyName" connectionProperty1="MyProperty" ... doc:name="CData SalesforcePardot: Configuration"/>
Connecting to Pardot
Connecting using OAuth2
Set the AuthScheme to OAuth to authenticate with this method.
Authenticating with OAuthJWT Certificate Authentication
Set the AuthScheme to OAuthJWT.
Authenticating with OAuthJWT
To obtain the OAuthJWT consumer key:
- Log in to Salesforce.com.
- From Setup, enter Apps in the Quick Find box and then click the link to create an app. In the Connected Apps section of the resulting page, click New.
- Enter a name to be displayed to users when they log in to grant permissions to your app, along with a contact Email address.
- Click Enable OAuth Settings and enter a value in the Callback URL box. Set this value only to create the Connected App as it is required. It will
not actually be needed for this type of authentication. The Callback URL is in the format:
- Enable Use digital signatures.
- Upload your certificate.
- Select the scope of permissions that your app should request from the user. At least the "pardot_api" and "api" scopes and/or "full" scope must be among the selected OAuth scopes.
- Click your app name to open a page with information about your app. The OAuth consumer key is displayed.
After creating your OAuth Application, set the following connection properties:
- AuthScheme: Set to OAuthJWT.
- InitiateOAuth: Set to GETANDREFRESH.
- OAuthJWTCert: Set this to the JWT Certificate store.
- OAuthJWTPassword: Set this to the Password of the JWT Certificate store.
- OAuthJWTIssuer: Set this to the OAuth Client ID.
- OAuthJWTCertType: Set this to the type of the certificate store specified by OAuthJWTCert.
Note: This flow never issues a refresh token.
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 Pardot in Mule applications.