Guide
Exporting data
Synchronous export and the asynchronous job flow, including polling and expiry.
Two modes. Synchronous returns the file on the same call; asynchronous creates a job you poll and then download.
| Mode | Ceiling | Use when |
|---|---|---|
| Synchronous | 100 MB | The resource is not one of the restricted ones below. |
| Asynchronous job | No practical ceiling | Required for any restricted resource, and for anything over the synchronous ceiling. |
The choice is not about convenience. Export Data API is restricted for the resources below; for these you must use the asynchronous export, and the synchronous call rejects them with 8133:
- Tables having more than one million rows.
- Tables and Views from live connect workspaces.
- Dashboard and Query Table view types.
Synchronous export#
var bulk = ac.getBulkInstance(orgId, workspaceId);
await bulk.exportData(viewId, 'csv', '/home/user/Sales.csv');Formats#
| Format | Applies to |
|---|---|
csv, json, xml | Tables, query tables, reports. |
xls | Tables and reports. |
pdf, html | Reports and dashboards. |
image | Charts. |
Asynchronous export#
Create the job, poll it, then download when it reports complete.
var bulk = ac.getBulkInstance(orgId, workspaceId);
var jobId = await bulk.initiateBulkExport(viewId, 'csv');
var job = await bulk.getExportJobDetails(jobId);
if (job.jobStatus === 'JOB COMPLETED') {
await bulk.exportBulkData(jobId, '/home/user/Sales.csv');
}Sample job response#
{
"status": "success",
"summary": "Get export job details",
"data": {
"jobId": "35130000001343084",
"jobStatus": "JOB COMPLETED",
"downloadUrl": "https://analyticsapi.zoho.com/restapi/v2/bulk/workspaces/35130000001055707/exportjobs/35130000001343084/data",
"expiryTime": "1735689600000"
}
}Polling#
Poll at a sensible interval โ a few seconds for small exports, tens of seconds for large ones. jobStatus moves through JOB NOT STARTED, JOB IN PROGRESS, then JOB COMPLETED or JOB FAILED. Treat JOB FAILED as terminal; the response carries the reason.