Joined model sync from Postgres, Airtable, and Stripe to Hubspot
UI demo video
Watch the same steps in the Polytomic admin console in this demo video.
Code
Set your Polytomic API key as an environment variable:
This example covers three steps:
- Create Airtable, Stripe, Postgres, and HubSpot Connections.
- Join the Airtable, Stripe, and Postgres data with Polytomic models.
- Sync the joined data to HubSpot.
Step 1: Create Connections
The following request creates an Airtable Connection. See the Airtable connection configuration for the required fields.
cURL
Python
Typescript
Go
Airtable Connections authenticate with OAuth. Open the URL returned in the auth_url field of the response to complete the flow.
OAuth redirection
By default, the API expects auth_url to open in a new browser window.
Set the optional redirect_url parameter in the request body to change
the redirect target.
The following request creates a Postgres Connection. See the Postgres connection configuration for the required fields.
The PostgreSQL server must be reachable from Polytomic over the network.
cURL
Python
Typescript
Go
The following request creates a Stripe Connection. See the Stripe connection configuration for the required fields.
cURL
Python
Typescript
Go
The following request creates a HubSpot Connection. See the HubSpot connection configuration for the required fields.
cURL
Python
Typescript
Go
HubSpot Connections authenticate with OAuth. Open the URL returned in the auth_url field of the response to complete the flow.
OAuth Redirection
By default, the API expects the auth_url to be open 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.
Step 2: Create joined models
The following request creates a User Details model over the Postgres users table:
cURL
Python
Typescript
Go
The following request creates a Customers model from Stripe, joined to User Details on the email field:
cURL
Python
Typescript
Go
The following request creates a Stars Data model from Airtable, joined to User Details on the email field:
cURL
Python
Typescript
Go
Step 3: Sync the joined data to HubSpot
The following request creates a Model Sync that loads the joined data into HubSpot:
