Joined model sync from Postgres, Airtable, and Stripe to Hubspot
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 Airtable, Stripe, Postgres, and HubSpot.
- Joining the data from Airtable, Stripe, and Postgres using Polytomic models.
- Syncing the data to HubSpot.
Step 1: Connecting to Airtable, Stripe, Postgres, and HubSpot
The following request will create an Airtable connection. The configuration for each type of connection can be found at the connection configuration page.
cURL
Python
Typescript
Go
Since Airtable 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.
The following request will create an Postgres connection. The configuration for each type of connection can be found at the connection configuration page.
The PostgreSQL server must be network-accessible from Polytomic.
cURL
Python
Typescript
Go
The following request will create an Stripe connection. The configuration for each type of connection can be found at the connection configuration page.
cURL
Python
Typescript
Go
The following request will create an HubSpot connection. The configuration for each type of connection can be found at the connection configuration page.
cURL
Python
Typescript
Go
Since HubSpot 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 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.
The following request will create a User Details
model using data from Postgres
cURL
Python
Typescript
Go
The following request will create a Customers
model using data from Stripe joined with the User Details
model using the email
field.
cURL
Python
Typescript
Go
The following request will create a Stars data
model using data from Airtable joined with the User Details
model using the email
field.
cURL
Python
Typescript
Go
Step 3: Sync the data to HubSpot
The following request will create a sync that loads the joined data into HubSpot.