How to Run a Manual Sync and Poll for Completion Using the REST API
Use Case / Scenario:
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 .
Fivetran Recommendation:
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 endpoint request to force a sync of your connector:
POST https://api.fivetran.com/v1/connectors/{connector_id}/sync{ "force": true }content_copyNOTE: Using the
"force": truepayload parameter in the request stops a sync that is in progress. If you don't want to stop a current sync, leave the payload empty.Use the endpoint request to check the status of the connector:
GET https://api.fivetran.com/v1/connectors/{your_connector_id}content_copy
Considerations:
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.
IMPORTANT: If you set the sync scheduling for your connector to
manual, you need to manually trigger your syncs after you make this change. If a manually-triggered sync was , you need to manually re-trigger that sync, since sync rescheduling only works with automatic sync scheduling.
Comments
0 comments
Please sign in to leave a comment.