Skip to main content

getFileMetadata

EntryMetadataWrapper getFileMetadata(fileId)

GET /api/2.0/files/metadata/file/{fileId}

Get file metadata

Returns the metadata of a file: the templates assigned to it, directly or inherited from a cascading folder above it, each with its fields, and the custom text fields set on the file. The caller needs read access to the file: a member of the portal, or an anonymous caller through an external link that grants access to the file or to a folder above it, with the link key in the Request-Token header or in the share query parameter. The call is read-only. A field carries its value inside it; a field the file holds no value for comes without a value. The custom fields are name and value pairs and are not part of any template. A file without metadata is answered with empty lists, not with an error. The same shape is returned by PUT api/2.0/files/metadata/file/{fileId}/values after a write. A request with neither a session nor a link key is answered with 401; a file the caller cannot read with 403, a file that does not exist with 404.

Parameters​

NameInTypeDescriptionNotes
fileIdpathInteger (int32)The file the operation addresses. Take the identifier from a listing such as GET api/2.0/files/{folderId}: a file stored on the portal is numbered, while a file in a connected third-party account is named by an opaque string.[required] [example: 10]

Responses​

Status codeDescriptionTypeResponse headers
200File metadataEntryMetadataWrapperX-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
401The caller has neither a session nor an external link key--
403You don't have enough permission to perform the operation--
404File not found--
429Too Many Requests.ErrorApiResponseRetry-After
500Internal Server Error.ErrorApiResponse-
400Bad Request.ErrorApiResponse-
502Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON.--
503Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON.--

Return type​

EntryMetadataWrapper

Authorization​

Basic, OAuth2 (scopes: read, write), ApiKeyBearer, asc_auth_key, Bearer, OpenId

HTTP request headers​

  • Content-Type: Not defined
  • Accept: application/json