Data Sync

Data Sync keeps a Vizzlo document’s data in sync with an external spreadsheet. A sync job is attached to a single document and periodically re-downloads a spreadsheet from a remote source (a public URL, a shared spreadsheet link, or a file in a connected cloud storage account) and feeds its data into the document.

A connection is a stored link between a Vizzlo user and a cloud storage account (Box, Dropbox, Google Drive, OneDrive, Smartsheet), used to reach private files. See also Cloud Storage.

The typical flow is:

  1. Check a source URL and inspect the available worksheets (/sync/document/check).
  2. Optionally read the raw data of the source (/sync/document).
  3. Create a sync job for a document (/sync/create).
  4. Later, read or delete the sync job (/sync/document/:document).

Requests that fetch data from a remote provider have a 45-second deadline. If the provider does not respond in time, HTTP status code 504 Gateway Timeout is returned.

Checking a data source

Validates a remote source URL and returns metadata about it (the detected provider and the available worksheets), without persisting anything.

Route

POST /api/v1/sync/document/check

Request payload
{
  "url": "https://example.com/data.xlsx"
}
Return value
NameTypeDescription
validbooleanWhether the source could be read.
provider_namestringThe detected provider (e.g. url, google-sheets, dropbox, box, onedrive, smartsheet, …).
source_errorobjectOptional: { "code": number, "message": string } describing why the source could not be read.
worksheetsarrayOptional: List of { "id": string, "name": string } objects, one per worksheet.
fixed_headersbooleanOptional: Whether the source uses fixed headers.
static_worksheetbooleanOptional: Whether the source has a single, static worksheet.

Reading data from a source

Downloads and returns the actual spreadsheet data of a source URL — either one named worksheet or the whole workbook.

Route

POST /api/v1/sync/document

Request payload
{
  "url": "https://example.com/data.xlsx",
  "worksheet_name": "Sheet1",
  "worksheet_id": ""
}

If worksheet_name or worksheet_id is given, only that single worksheet is returned; otherwise the full workbook is returned.

Return value

When a single worksheet is requested, a worksheet object is returned:

{
  "name": "Sheet1",
  "sheet_id": "0",
  "rows": [
    ["Label", "Value"],
    ["Q1", 12]
  ]
}

When the full workbook is requested, a JSON array of such worksheet objects is returned. Cells are serialized as strings or numbers; date cells are returned as objects with type, display_value, date_string, and formatting_string.

Creating a sync job

Creates (or replaces) the sync job for a document. If the document already has a sync job, it is replaced. Requires write access to the document.

Route

POST /api/v1/sync/create

Request payload
NameTypeDescription
document_idstringRequired: UUID of the Vizzlo document to attach the sync job to.
urlstringRequired: The remote source URL to sync from.
document_settingsobjectOptional: Vizzard-specific settings applied to the document when syncing.
sheet_namestringOptional: Name of the worksheet to sync.
sheet_idstringOptional: ID of the worksheet to sync.
interval_secnumberSync interval in seconds.
time_of_day_utcstringTime of day to sync (HH:MM, UTC). Required when interval_sec is greater than 0.
day_of_weeknumberDay of the week to sync (Sunday is 0).
Return value

No content (HTTP status code 204) upon success.

Reading a sync job

Returns the sync job configuration and last download state for a document. Requires write access to the document.

Route

GET /api/v1/sync/document/document

Query parameters
Return value
NameTypeDescription
document_settingsobjectVizzard-specific settings applied when syncing.
urlstringThe remote source URL.
sheet_namestringName of the synced worksheet.
sheet_idstringID of the synced worksheet.
interval_secnumberSync interval in seconds.
time_of_day_utcstringTime of day the sync runs (HH:MM, UTC).
day_of_weeknumberDay of the week the sync runs (Sunday is 0).
prepared_dataobjectOptional: The most recently prepared data.
downloaded_atstringOptional: Timestamp (RFC 3339) of the last successful download.
next_download_atstringOptional: Timestamp (RFC 3339) of the next scheduled download.
errorstringOptional: The last download error, if any.

If the document has no sync job, HTTP status code 404 is returned.

Deleting a sync job

Removes the sync job attached to a document. Requires write access to the document.

Route

DELETE /api/v1/sync/document/document

Return value

No content (HTTP status code 204) upon success.

Listing sync providers

Lists all supported cloud storage providers together with the current user’s access level and existing connections for each.

Route

GET /api/v1/sync/providers

Return value

A JSON array of provider objects:

NameTypeDescription
namestringProvider identifier: box, dropbox, googledrive, onedrive, or smartsheet.
descriptionstringHuman-readable provider name (e.g. “Google Drive”).
accessstringThe user’s access level for this provider: none, partial, or full.
auth_urlstringOptional: URL to start the OAuth flow to connect this provider.
connectionsarrayOptional: The user’s existing connections for this provider (see below).

Listing sync connections

Lists the current user’s stored cloud storage connections as a flat list.

Route

GET /api/v1/sync/connections

Return value

A JSON array of connection objects:

NameTypeDescription
idstringConnection ID, used to identify the connection in other API calls.
providerstringThe cloud storage provider of this connection.
titlestringUser-visible title of the connection.
email_addressstringEmail address used at the cloud storage provider.
scopesstringOptional: OAuth scopes granted for this connection.
urlsobjectOptional: Related URLs for this connection.

Access tokens are never included in the response.

Deleting a sync connection

Removes one of the current user’s cloud storage connections.

Route

DELETE /api/v1/sync/connections/connectionId

Return value

No content (HTTP status code 204) upon success. If the connection does not exist or does not belong to the current user, HTTP status code 404 is returned.