Salesforce

๐Ÿ Salesforce Destination Setup โ€“ Connecting Salesforce to AudienceSync

๐Ÿง  Overview

This guide walks you through setting up Salesforce as a destination in AudienceSync. Youโ€™ll learn how to configure a Connected App, obtain OAuth credentials, and generate access and refresh tokens for secure syncing.


โœ… Prerequisites

Before starting, ensure youโ€™re using one of the following Salesforce editions:

  • Enterprise Edition
  • Professional Edition (with API access add-on)
๐Ÿ” These editions support the required API access for syncing.

๐Ÿ”ง Destination Setup Steps

1. Login to Salesforce

  • Log in with an admin account.
  • Click Setup (top-right menu).

2. Go to App Manager

  • In the left sidebar, click:
    • Apps โ†’ App Manager

3. Create a New Connected App

  • Click New Connected App (top-right button).

4. Fill App Details

  • Provide:
    • App Name
    • API Name
    • Contact Email

5. Enable OAuth Settings

  • In the API section, check "Enable OAuth Settings".
  • Callback URL:
    • https://login.salesforce.com/

  • Add the following OAuth Scopes:
    • Access and manage your data (api)
    • Perform requests on your behalf at any time (refresh_token, offline_access)
    • Provide access to your data via the Web (web)

6. Save the App

7. Manage the App

  • Return to Apps โ†’ App Manager.
  • Find your app and click Manage.

8. Edit OAuth Policies

  • Click Edit.
  • Set Permitted Users to
    • All users may self-authorize

  • Save changes.

9. View the App

  • Go back and click View next to your app.

10. Copy Your Credentials

  • Scroll to the API (OAuth Settings) section.
  • Click Manage Consumer Details.
  • Save these values:
    • Consumer Key
    • Consumer Secret

๐Ÿ” Obtaining OAuth Credentials

Step 1: Get the Authorization Code

  • Open this URL in your browser (replace placeholders):
plaintext
CopyEdit
https://INSTANCE_URL.salesforce.com/services/oauth2/authorize?response_type=code&client_id=CONSUMER_KEY&redirect_uri=https://login.salesforce.com/

  • Grant access if prompted.
  • The URL will redirect and contain a ?code=... parameter.
    • Copy the value of code.


Step 2: Exchange the Code for Tokens

Run the following curl command (replace placeholders):

bash
CopyEdit
curl -X POST "https://INSTANCE_URL.salesforce.com/services/oauth2/token?code=CODE&grant_type=authorization_code&client_id=CONSUMER_KEY&client_secret=CONSUMER_SECRET&redirect_uri=https://login.salesforce.com/"

The response will include:

json
CopyEdit
{
  "access_token": "your_access_token",
  "refresh_token": "your_refresh_token",
  "instance_url": "https://your-instance.salesforce.com",
  ...
}

Store these credentials securely. You will use them to connect AudienceSync to Salesforce.


๐Ÿ”„ Supported Sync Modes

Sync Mode
Supported
Incremental Sync
โœ… Yes
Full Refresh
๐Ÿšง Coming Soon

๐Ÿ“ค Supported Streams

Stream
Supported
Account
โœ… Yes
More stream types will be added in future updates.

Did this answer your question?
๐Ÿ˜ž
๐Ÿ˜
๐Ÿคฉ

Last updated on August 6, 2021