It focuses on scenarios where you already know the file ID (for example, obtained from a previous
files
query) and you need to retrieve short-lived link paths (downloadPath
and previewPath
) to access the file.
This pattern is typically used when:
- You first list files with metadata only (without requesting link paths).
- Later, when a user selects a file to open, you run a new
files
query filtered by its ID to get a fresh valid link.
The returned link paths are temporary and must be consumed quickly:
- downloadPath always forces download of the file (due to the
Content-Disposition: attachment
header). - previewPath displays the file inline when possible, with optional HTML previews for
.csv
,.xml
, and.txt
.