Set up a Developer Sandbox in Salesforce
Sign up for a developer account
Sign up for a free Salesforce developer account by visiting the Sign up for your Salesforce Developer Edition page.
After successfully creating your account, you will receive an email with instructions to access your sandbox environment.
Create an External Id field for the Account Object
Log in to Salesforce. Ensure you are using the Lightning Experience UI.
Click the menu icon in the upper right corner and select Setup.
Click the Object Manager tab and select the Account object.
Select Fields & Relationships from the sidebar menu.
Click the New button.
Select Text as the data type and click Next.
Configure field metadata as follows:
Field Label: customExtIdField Length: 20 Field Name: customExtIdField External ID: selected
Complete the setup with default settings and save the field.
Use the Search function to confirm the new field is present.
Create a OAuth Connected App
Warning
The configuration outlined here is intended solely for tutorial purposes.
Please consult with your security team to determine the appropriate configuration for your live or production environments.
Go to the Home tab on the Setup page and search for App Manager.
Click New Connected App
Enter the following information:
Connected App Name: Learn SW API Name: Learn SW Contact Email: <your email address> Enable Oauth Settings: checked Callback URL: https://login.salesforce.com/services/oauth2/success Selected OAuth Scopes: id, api and refresh_token
Configure additional oAuth settings as follows:
Save the application and Click Manage Consumer Details.
Please make a note of the values for Consumer Key and Consumer Secret for future reference.
Return to the previous page, and click Manage.
Click Edit Policies.
Update the following settings as needed:
Save the settings and return to the previous page.
Click Manage Profiles and select System Administrator from the list:
Save the settings to finalize the Connected App setup.
Generate a Refresh Token
Open a new browser tab and navigate to the following URL:
https://<Org Domain>.my.salesforce.com/services/oauth2/authorize?client_id=<Consumer Key>&redirect_uri=https://login.salesforce.com/services/oauth2/success&response_type=code
Replace <Org Domain> with your Salesforce organization domain (e.g., snoweaver-dev-ed.develope) and <Consumer Key> with the key obtained in the previous step.
You may need to log in again. After logging in, the browser may display a blank page.
Examine the URL of the blank page and locate the code parameter. Note its value, which will be URL-encoded and end with %3D%3D (the HTML-encoded representation of ==).
Open a Command Line Terminal (such as LinuxShell or PowerShell).
Execute the following curl command in the terminal, ensuring you replace the URL-encoded == (%3D%3D) with the actual == in the authorization code:
curl -X POST -H "Content-type: application/x-www-form-urlencoded" \ -d "grant_type=authorization_code" \ -d "code=<Authorization Code>" \ -d "client_id=<Consumer Key>" \ -d "client_secret=<Consumer Secret>" \ -d "redirect_uri=https://login.salesforce.com/services/oauth2/success" \ https://<Org Domain>.my.salesforce.com/services/oauth2/token
If you using a shell with jq installed, append | jq . to the command for improved formatting of the JSON response.
The response should be a JSON document containing the refresh token, which you’ll use to configure the OAuth integration in Snowflake.