Introduction
Building on the setup of your API collection, this article explains how to use the Workiva API to export files from Workiva. This guide is applicable when exporting:
- Documents as .PDF, .DOCX, or .XHTML
- Spreadsheets as .XLSX, .PDF, or .CSV
- Presentations as .PDF or .PPTX
An additional option is available for exporting native Workiva files in .tar.gz format.
Prerequisites
Before proceeding, ensure you have completed all steps in the Importing Workiva API Collections into Postman guide.
Authentication
- Open your Postman workspace and ensure the correct environment is selected.
-
Expand the IAM Services collection, open the OAuth2 folder, and select Retrieve a token.
- Click Send to generate an authentication token. The token is automatically stored in the {{access_token}} environment variable and will be used by all subsequent requests.
Note: The access token expires after 600 seconds (10 minutes). Once expired, repeat this step to generate a new token.
Initiate a File Export (Documents, Presentations, Spreadsheets)
This example focuses on exporting Workiva documents as .PDF, .DOCX, or .XHTML. The same concepts apply when exporting spreadsheets or presentations.
- Expand the Platform API collection and navigate to Documents → Document ID → Export.
- Open the Initiate a document export request.
- In the Parameters tab, enter the documentId.
- Update the request body to specify the export format:
-
{ "pdfOptions": { "includeAlternateRowFill": true, "includeAttachmentLabels": true, "includeComments": true, "includeDraftWatermark": true, "includeHyperlinks": true, "includeLeaderDots": true, "includeTrackChanges": true, "tagForWebAccessibility": true, "useCmykColorspace": true }, "format": "pdf", "sections": [] } -
{ "docxOptions": { "includeLeaderDots": true, "showTableCellShading": true }, "format": "docx", "sections": [] } -
{ "xhtmlOptions": { "editableSimple": true, "editableXhtml": false, "includeExternalHyperlinks": false, "includeHeadersAndFooters": false }, "format": "xhtml", "sections": [] }
-
- Send the request to initiate the export. This process consists of three steps:
-
Send the POST request. The response includes a
Locationheader containing a URL. -
Make a GET request to the URL in the
Locationheader to check the export status and retrieve the resource URL once processing completes. -
Make a final GET request using the resource URL to download the exported file.
-
The exported file may be returned as binary data. This is expected behavior. Simply save the file using the appropriate extension (for example, .pdf, .docx, or .xhtml).
Next, review how to import a file using the API Collection.