Skip to content

Latest commit

 

History

History
149 lines (117 loc) · 6.47 KB

File metadata and controls

149 lines (117 loc) · 6.47 KB

Salesforce


Config

You must enter the following settings when configuring this source:

Key Description Sample value
api_type The api_type is used to switch the behavior of the tap between using Salesforce's "REST" and "BULK" APIs. When new fields are discovered in Salesforce objects, the select_fields_by_default key describes whether or not the tap will select those fields by default. REST, BULK
domain Your Salesforce instance domain. Use 'login' (default) or 'test' (sandbox), or Salesforce My domain. test, login
select_fields_by_default If true, the fields in a schema of a stream will all be selected by default when setting up a synchronization. true, false
start_date The start_date is used by the tap as a bound on SOQL queries when searching for records. This should be this exact format YYYY-mm-ddTHH:MM:SSZ. 2022-11-30T21:31:20Z

If using OAuth based authentication:

Key Description Sample value
client_id OAuth Salesforce App secrets. ABC1...
client_secret OAuth Salesforce App secrets. ABC1...
refresh_token The refresh_token is a secret created during the OAuth flow ABC1...

If using Password based authentication:

Key Description Sample value
username Salesforce account username ABC1...
password Salesforce account password ABC1...
security_token Salesforce account security token ABC1...

Optional settings:

Key Description Sample value
threshold When running INCREMENTAL sync runs, threshold is used to throttle how often STATE messages are generated (in REST api_type).This can be useful to minimize the amount of STATE messages being generated. Defaults to 1000
streams List of stream names to be discovered inside the salesforce tap. if none is given, the tap will search for all avaliable streams, which can take several minutes. ["Account"]

How to get your client_id, client_secret, and refresh_token

Find your client_id and client_secret

  1. Sign into your Salesforce account.
  2. Create a Connected App and Enable OAuth Settings for API Integration by following this Salesforce documentation.
    1. Use the following URL as the callback URL: https://login.salesforce.com/services/oauth2/success
  3. When you are at the step to choose which OAuth Scopes to authorize, you must give your Connected App at least these 2 scopes:
    1. Manage (api)
    2. Perform requests at any time (refresh_token)
  4. After you created a Connected App, go to your Setup and click on the Home tab.
  5. On the left sidebar under the Platform tools > Apps > App Manager, click on App Manager.
  6. Find the row that contains the app you just created. On the furthest right column, click the dropdown caret icon and click View.
  7. Under the API (Enable OAuth Settings) section, find the subsection labeled Consumer Key and Secret and click the button Manage Consumer Details.
  8. A new page will open, displaying your Consumer Key (which is your client_id) and Consumer Secret (which is your client_secret).

Authorize your Connected App

  1. Construct a URL with the following format: https://[your_salesforce_domain].my.salesforce.com/services/oauth2/authorize?client_id=[client_id]&redirect_uri=https://login.salesforce.com/services/oauth2/success&response_type=code
Variable Description Sample value
[your_salesforce_domain] The domain of your Salesforce account. mage-dev-ed
[client_id] Your Consumer Key ABC123...
  1. Open that URL in a browser.
  2. Authorize your Connected App to have API access to your Salesforce account.
  3. Once you authorize, you’ll be redirect to a URL like this: https://login.salesforce.com/services/oauth2/success?code=[code].
  4. Note the value of the code URL parameter, it’ll be used to get a refresh_token.

Get a refresh_token

Open a terminal and make the following POST request:

curl -X POST https://[your_salesforce_domain].my.salesforce.com/services/oauth2/token \
   -H "Content-Type: application/x-www-form-urlencoded"  \
   -d "grant_type=authorization_code&code=[code]&client_id=[client_id]&client_secret=[client_secret]&redirect_uri=https://login.salesforce.com/services/oauth2/success"

Change the following URL parameters to match your credentials:

URL parameter Description Sample value
[your_salesforce_domain] The domain of your Salesforce account. mage-dev-ed
[code] The code you received after authorizing your Connected App ABC123...
[client_id] Your Consumer Key ABC123...
[client_secret] Your Consumer Secret ABC1...

Once you execute the above CURL command successfully, you’ll receive a response that could look like this:

{
  "access_token": "...",
  "refresh_token": "...",
  "signature": "...",
  "scope": "...",
  "id_token": "...",
  "instance_url": "https://[your_salesforce_domain].my.salesforce.com",
  "id": "https://login.salesforce.com/id/.../...",
  "token_type": "Bearer",
  "issued_at": ""
}

Take note of the refresh_token, it’ll be used when you configure this source.

Additional resources in case you get lost


Schema

The available schema depends on the objects in your Salesforce account.

Some example schema can include the following (depending on your account):

  • AIApplication
  • AIApplicationConfig
  • AIInsightAction
  • AIInsightFeedback
  • AIInsightReason
  • AIInsightValue
  • AIPredictionEvent
  • AIRecordInsight
  • AcceptedEventRelation
  • Account
  • ...
  • WorkTypeFeed
  • WorkTypeGroup
  • WorkTypeGroupFeed
  • WorkTypeGroupHistory
  • WorkTypeGroupMember
  • WorkTypeGroupMemberFeed
  • WorkTypeGroupMemberHistory
  • WorkTypeGroupShare
  • WorkTypeHistory
  • WorkTypeShare
  • and more...