Cursor synchronization API
Once you have enabled the Cursor synchronization API in your account admin section, you can now use this information on this page to connect to the service.
Overviewβ
Cursor APIs are designed to make data synchronization between systems efficient and reliable. Instead of retrieving all records every time you sync, a cursor API allows you to fetch only the new or updated data since your last request. This is achieved by using a βcursorββa unique marker or token that represents a specific point in the data stream.
The Initial Cursorβ
When you first connect to the Cursor API, you typically start with an initial cursor. This cursor will be provided by the API, by default the API assumes you want to start at the beginning, syncing from the very start of the dataset. The API will then return the first batch of data along with a new cursor value. If you wish to start from a specific point you must request this along side your initial cursor request.
Fetching Data with the Cursorβ
Each time you make a request to the API, you include the current cursor value. The API responds with the next set of records and an updated cursor. This process continues, allowing you to βpageβ through the data efficiently. If there are no new records, the API will return an empty result set but still provide a cursor for your next check.
Keeping Track of Cursorsβ
It is important to store the latest cursor value after each successful sync. This ensures that, if your integration is interrupted or restarted, you can resume syncing from exactly where you left offβwithout missing any data or processing the same records twice. Cursors are typically stored in your applicationβs database or persistent storage.
Example Workflowβ
- Authenticate
- Request the initial cursor (with or without a starting point).
- Fetch data using the cursor. Note the request will provide data so this can be skipped.
- Process the returned records in your system.
- Store the new cursor value provided by the API.
- Repeat the process on a schedule, always using the most recent cursor.