Use Case / Scenario:link
You want to use the REST API to manually sync a connector and understand when that sync has completed from the command line. You may want this to run your connector on a custom schedule with cron.
Fivetran Recommendation:link
We recommend that you use the scripting language of your choice to call the Fivetran REST API to manually sync the connector and then poll our API for a completion status.
-
Find the connector ID for your connector.
-
Use the Sync Connector Data endpoint request to force a sync of your connector:
POST https://api.fivetran.com/v1/connectors/{your_connector_id}/force
-
Use the Retrieve Connector Details endpoint request to check the status of the connector:
GET https://api.fivetran.com/v1/connectors/{your_connector_id}
Considerations:link
Using polling, you will know whether a sync has completed but not necessarily get an accurate estimate of how long the sync actually took. Polling adds some time value, which may be as large as your polling frequency interval, to that estimate.