API Reference

Initiate a document export

Description

Asynchronously exports a document as .PDF or .DOCX. Options are specified using a DocumentExport object.

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.

POST /documents/{documentId}/export

🚧

Required OAuth Scopes:

file:read

Parameters

ParameterInTypeRequiredDescription
documentIdpathstringtrueThe unique identifier of the document
bodybodyDocumentExporttrueDetails about the document export.

Body parameter example

{
  "docxOptions": {
    "includeLeaderDots": true,
    "showTableCellShading": true
  },
  "format": "docx",
  "sections": [
    "a8b3adb687644b27fafcb3a9875f0f0d_18",
    "a8b3adb687644b27fafcb3a9875f0f0d_19"
  ]
}

Code Samples

curl -X POST https://api.app.wdesk.com/platform/v1/documents/{documentId}/export  \ 
-H 'Content-Type: application/json' \ 
-H 'Authorization: Bearer {access-token}'
http POST https://api.app.wdesk.com/platform/v1/documents/{documentId}/export  \ 
Content-Type:application/json \ 
Authorization:"Bearer {access-token}"
wget --method=POST "https://api.app.wdesk.com/platform/v1/documents/{documentId}/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/documents/{documentId}/export', headers = headers)

print(r.json())

Returns

202 - Accepted

HeaderDescription
LocationThe location to poll for the operation result.
Retry-AfterThe number of seconds to wait before polling for a result and between polling attempts.