Sync data with Census
Census synchronizes customer insights from your cloud data warehouse to all the SaaS tools your team utilizes, including Salesforce, HubSpot, Customer.io, Slack, and Zendesk.
With Python Actions, Y42 enables programmatic triggering of Census syncs via its API.
Create Sync in Census
Syncs establish connections between your Data Warehouse sources and Destination Services. For detailed information, refer to the Census documentation (opens in a new tab).
Create a new sync or use an existing one. Choose as source for the Sync, one of the tables published by Y42 in your data warehouse.
Sync between BigQuery table and Google Sheets.
Trigger Sync via its API
You can trigger each sync programmatically through its API. The sync configuration page provides the trigger API endpoint.
To initiate the sync, use the following POST request format:
_10https://bearer:{api_token}@app.getcensus.com/api/v1/syncs/{sync_id}/trigger
Initiate the sync
Store the API Token as a Secret in Y42
You can securely store API tokens (or any other secrets) within Y42 using the Secrets menu.
Store the API Token as a Secret in Y42.
Create Python Action asset
- Create the Python Action asset: Use the POST request method outlined earlier and reference the API Token from the Secrets vault.
- Specify an upstream dependency (Optional, but recommended): In the Dependencies tab, you can specify an upstream dependency for the Python asset. This dependency acts as a trigger, activating the Python Action to synchronize data with a third-party application upon the successful completion of the upstream asset.
It's often practical to select the source table, which was utilized to establish the Sync, as the dependency.
Specify an upstream dependency to act as the trigger for the Python asset.
Build asset
Build the asset using dag selectors or via the Build history
tab.
The +
selector, when used in front of the asset name in the command, also triggers all upstream dependencies.
Build history tab.
Verify Sync status in Census
After returning to the Census interface, the sync should be activated, having data to flowing to your configured destination. Congrats! 🎉
Sync successfully triggered.