Retrieve a file
Retrieve a file, either its JSON representation or its content.
Access
Access
Authorizations
The Lucca API implements the oAuth 2 protocol with the client-credentials-flow. Refer to RFC8725.
Headers
The Accept response header indicates the content type of the response.
Accept: application/octet-streamreturns the raw file content.Accept: image/*returns a preview of the file (when possible).- If Accept matches exactly
file.contentType, returns the raw file content. Accept: application/jsonorAccept: */*or no Accept header (default) returns the file metadata in JSON format.
Set the API version.
2024-11-01 "2024-11-01"10"2024-11-01"
Query Parameters
The token allowing to access the file, required in addition to the access token: the access token lets you use the files API, and this token, minted by the service that owns the file, lets you view this file.
This token can only be obtained via the API resource that references this file, read with ?include=links: links.files["{id}"].token (e.g. on an employee-attribute, an employment, a job-position or an employee).
It is bound to the API client that read the resource, and expires after links.files["{id}"].expiresAt. The deprecated links.document and links.portrait links also carry one, whose expiry is not exposed.
1Specifies how the file should be handled by the client.
Supersedes the Accept header when possible. To be used whenever the API client cannot set custom Accept headers.
json(default) returns the file metadata in JSON format.inlinereturns the file content to be displayed inline in the browser (when possible).attachmentreturns the file content as a download.
json, inline, attachment Include metadata:
embedded: the partial or complete representations of related resources (e.g. the employee the resource belongs to).links: links to related resources or actions (e.g. approving a leave-request). May benullwhen you do not have access to the resource (or action). Includes the download links of the files the resource references, underlinks.files.totalCount: only applicable on collections (i.e. lists of resources), gives the total number of items across all pages.
Read more about expanding responses.
embedded, links, totalCount Response
Representation of the requested file, either its JSON representation or its content.
JSON representation of a file. A file may be downloaded via the Accept: octet-stream HTTP header.
Indicates the content-type of the file. Refer to the enum values to figure out which are accepted.
message/rfc822, binary/octet-stream, unknown/unknown, audio/mpeg, video/mp4, image/png, image/heic, image/heif, image/jpe, image/jpg, image/pjpeg, image/gif, image/bmp, image/tif, image/tiff, image/x-dcraw, image/x-jb2, image/x-jbig2, image/x-jpf, image/x-ms-bmp, image/x-panasonic-raw, image/x-pcx, image/x-icon, image/x-png, image/vnd.microsoft.icon, image/webp, image/svg+xml, image/x-portable-anymap, text/plain, text/csv, text/rtf, text/calendar, text/comma-separated-values, text/css, text/html, text/xml, text/markdown, text/x-affix, application/pdf, application/msword, application/xls, application/x-csv, application/ms-excel, application/vnd.ms-office, application/vnd.ms-word, application/vnd.ms-outlook, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/vnd.ms-excel.sheet.binary.macroEnabled.12, application/vnd.ms-excel.sheet.macroEnabled.12, application/vnd.ms-pki.stl, application/vnd.ms-xpsdocument, application/vnd.oasis.opendocument.text, application/vnd.oasis.opendocument.spreadsheet, application/vnd.oasis.opendocument.presentation, application/vnd.oasis.opendocument.graphics, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.openxmlformats-officedocument.presentationml.presentation, application/vnd.openxmlformats-officedocument.presentationml.slideshow, application/vnd.openxmlformats-officedocument.presentationml.template, application/x-7z-compressed, application/rar, application/x-rar, application/zip, application/andrew-inset, application/binary, application/csv, application/download, application/force-download, application/x-download, application/hta, application/javascript, application/json, application/mac-binhex40, application/oleobject, application/pkcs7-signature, application/postscript, application/rtf, application/text, application/txt, application/unknown, application/x-iwork-keynote-sffkey, application/x-ms-application, application/x-ms-manifest, application/x-msdownload, application/x-pdf, application/x-unknown, application/x-zip-compressed, application/xml, application/x-wine-extension-ini, application/vnd.hp-hpgl, application/x-sega-pico-rom