Querying Salesforce using SOQL
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.
- Executing a SOQL query on your Salesforce instance.
- Reading the results of your query from Polytomic.
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. Start a SOQL query
THe following request will start a SOQL query on your Salesforce instance. The query will be executed and the results will be available via the Polytomic API.