Description
Asynchronously exports a spreadsheet as .XLSX, .PDF, or .CSV.
Responses include a Location
header, which indicates where to poll for export results. For more details on long-running job polling, see Operations endpoint. When the export completes, its status will be completed
, and the response body includes a resourceURL
. To download the exported file, perform a GET on the resourceURL
with the same authentication credentials and flow as the export request. For more details, see Authentication documentation.
Note: To export to .PDF, the spreadsheet can have no more than 250,000 cells.
POST
/spreadsheets/{spreadsheetId}/export
Required OAuth Scopes:
file:read
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
spreadsheetId | path | string | true | The unique identifier of the spreadsheet |
body | body | SpreadsheetExport | true | Details about the spreadsheet export, including its format and options |
Body parameter example
{
"format": "xlsx",
"sheets": [
"7c8d8c4a46784455bg68t36f9d8232d8",
"54bgd83b471e5902f1a8e8c9a299c9fb"
],
"xlsxOptions": {
"exportAsFormulas": true,
"exportPrecision": "displayed"
}
}
Code Samples
curl -X POST https://api.app.wdesk.com/platform/v1/spreadsheets/{spreadsheetId}/export \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {access-token}'
http POST https://api.app.wdesk.com/platform/v1/spreadsheets/{spreadsheetId}/export \
Content-Type:application/json \
Authorization:"Bearer {access-token}"
wget --method=POST "https://api.app.wdesk.com/platform/v1/spreadsheets/{spreadsheetId}/export" \
--output-document - \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {access-token}'
import requests
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://api.app.wdesk.com/platform/v1/spreadsheets/{spreadsheetId}/export', headers = headers)
print(r.headers['Location'])
Returns
202 - Accepted
Header | Description |
---|---|
Location | The location to poll for the operation result. |
Retry-After | The number of seconds to wait before polling for a result and between polling attempts. |