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"] |
- Sign into your Salesforce account.
- Create a Connected App and Enable OAuth Settings for API Integration
by following this Salesforce documentation.
- Use the following URL as the callback URL: https://login.salesforce.com/services/oauth2/success
- When you are at the step to choose which OAuth Scopes to authorize, you must give your
Connected App at least these 2 scopes:
- Manage (
api
) - Perform requests at any time (
refresh_token
)
- Manage (
- After you created a Connected App, go to your Setup and click on the Home tab.
- On the left sidebar under the Platform tools > Apps > App Manager, click on App Manager.
- Find the row that contains the app you just created. On the furthest right column, click the dropdown caret icon and click View.
- Under the API (Enable OAuth Settings) section, find the subsection labeled Consumer Key and Secret and click the button Manage Consumer Details.
- A new page will open, displaying your Consumer Key (which is your
client_id
) and Consumer Secret (which is yourclient_secret
).
- 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... |
- Open that URL in a browser.
- Authorize your Connected App to have API access to your Salesforce account.
- Once you authorize, you’ll be redirect to a URL like this:
https://login.salesforce.com/services/oauth2/success?code=[code]
. - Note the value of the
code
URL parameter, it’ll be used to get arefresh_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.
- https://stackoverflow.com/questions/12794302/salesforce-authentication-failing/29112224#29112224
- https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_oauth_and_connected_apps.htm
- https://help.salesforce.com/s/articleView?id=sf.remoteaccess_oauth_web_server_flow.htm&type=5
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...