Bulk sync (ELT) from Salesforce to Snowflake
UI demo video
You can watch a demo video of these operations in Polytomic’s admin console here.
Code
Before getting started make sure to set your Polytomic API key as an environment variable:
This example tutorial will cover three steps:
- Connecting to Salesforce.
- Connecting to Snowflake.
- Loading data from Salesforce into Snowflake.
1. Create a Salesforce connection
The following request will create a Salesforce connection. The configuration for each type of connection can be found at the connection configuration page.
cURL
Python
Typescript
Go
Since Salesforce connections uses OAuth to authenticate, we’ll need to follow the link returned in the auth_url
parameter in the response
Redirection
By default, the API expects the auth_url
to be opened in a new browser window. If you’d like to modify the redirect behavior, there is an optional redirect_url
parameter that can be added to the request body.
2. Create an Snowflake Connection
The Snowflake instance must be network-accessible from Polytomic. For more information, see our Snowflake connection guide.
cURL
Python
Typescript
Go
3. Create a bulk sync
This will create a bulk sync of the Account
and Contact
Salesforce objects into Snowflake:
Important: If the schemas parameter is omitted, all objects will be synced.
cURL
Python
Typescript
Go
Bulk sync schemas
Polytomic may take a few moments to cache source schemas after creating new connections. The message {"status":400,"message":"No schemas found. This can mean that the Polytomic has not cached any schemas yet. Please try again.","metadata":null}
indicates that the schemas are not ready to be used in bulk sync configuration yet. This request is safe to retry until receiving a 2xx response.