Download Document
GET /people/documents/{id}/download
Group: People Management › Documents · Operation ID: downloadDocument
Returns a short-lived download link for the document with the given identifier, along with the file's name, MIME type and size. The file content itself is not returned. Request the link when a download starts rather than storing it, because it expires.
Open in the interactive reference
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Api-Version |
header | "v1" |
yes | The API version this request targets, named by its public identifier. Required on every request; omitting it, or naming a version this company does not have, is answered with 400. This document describes version v1. |
id |
path | string | yes | The unique identifier for the document to download. |
Response
200 Success
Under data (downloadDocumentOutput):
| Field | Type | Required | Description |
|---|---|---|---|
id |
string | yes | The unique identifier for the document the link points at. |
fileName |
string | yes | The stored file name of the document. Save the downloaded bytes under it. |
mimeType |
string | no | The MIME type of the stored file. Absent when storage does not report one. |
fileSizeBytes |
number | no | The size of the stored file in bytes. Absent when storage does not report one. |
downloadUrl |
string | yes | A short-lived pre-signed URL the file's bytes are fetched from. It expires and is not a stable link. |
Errors
| Code | Status |
|---|---|
NOT_FOUND |
400 |
FILE_UNAVAILABLE |
400 |
Statuses
400— Invalid request or business failure. Codes: NOT_FOUND, FILE_UNAVAILABLE401— Missing or invalid access token403— Not authorized404— Not found429— Too many requests500— Internal server error