Salesforce Marketing Cloud

Authenticating to the Salesforce Marketing Cloud REST API

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.

You can follow the procedure below to register an app and obtain the OAuth client credentials, the Client Id and Client Secret:

  1. Log in to your Salesforce Marketing Cloud Go to Marketing Cloud | Administration | Installed Packages.

  2. Click New.

  3. Give the package a name and description.

  4. Save the package. Once the package is saved, you see important details about the package. See Installed Packages Definitions for more information about each field. You see the Package ID, JWT Signing Secret, and Source Account only for packages created in your account.

  5. Under Components, click Add Component.

  6. Select API Integration.

  7. You must select Server-to-Server or Web App as integration type if the package supports enhanced functionality.

  8. Assign the appropriate scope for your integration.

    • Perform server-to-server requests... is automatically selected for all API Integrations.

    • Select Perform requests on behalf of the user... if this package contains a Marketing Cloud app.

    • Select the Marketing Cloud scope for your API calls. Assign only the scope your package needs.

  9. Save the component.

  10. Under the component details, you can find the Client ID and Client Secret.

After setting the following connection properties, you are ready to connect:

  • InitiateOAuth: Set this to GETANDREFRESH. You can use InitiateOAuth to avoid repeating the OAuth exchange and manually setting the OAuthAccessToken connection property.

  • OAuthClientId: Set this to the Client ID in your app settings.

  • OAuthClientSecret: Set this to the Client Secret in your app settings.

  • AccountId: Set this to the specific MID of the target business unit. This is not available for legacy packages.

  • CallbackURL: Set this to the URL in your app settings. Note: The default value is

When you connect the provider completes the OAuth process.

  1. Exchanges the OAuthClientId and OAuthClientSecret for the OAuthAccessToken.

  2. Refreshes the access token when it expires.

  3. Saves OAuth values in OAuthSettingsLocation to be persisted across connections.

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, or to the credentials for a sandbox user if you are connecting to a sandbox account.

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:

  • UseSandbox: Set this to true to use a Salesforce Marketing Cloud sandbox account.

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

Last updated