# IRPCObjectOperations.GetObjectFiles

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Vault API](https://developer.m-files.com/APIs/gRPC-API/vault/index.md) > [Objects, versions, properties and files](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectOperations/index.md)

HTML version: https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectOperations/GetObjectFiles/

Badges: `Vault API / core` `write` `session or assertion` `returns metadata structure version`

Gets the files of a specific object version.

- **Service:** [Objects, versions, properties and files](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectOperations/index.md) `MFiles.IRPCObjectOperations`
- **gRPC method:** `/MFiles.IRPCObjectOperations/GetObjectFiles`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/get-object-files`
- **Request:** [`GetObjectFilesRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectOperations/GetObjectFiles/index.md#request)
- **Response:** [`GetObjectFilesResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectOperations/GetObjectFiles/index.md#response)
- **Book and level:** Vault API, core
- **Kind:** write
- **Session:** Required: a session (mfiles-session-id-bin metadata) or a session assertion (x-mf-session-assertion metadata).
- **Idempotent:** no
- **Returns metadata structure version:** yes (in the mfiles-metadata-version-bin trailer)
- **Streaming:** none (unary)

<a id="remarks"></a>

## Remarks

`obj_ver` must name a specific version; the `OBJ_VER_VERSION_TYPE_LATEST` marker fails with "Not
found.". You often do not need this call: the version information returned by the read methods
([ObjectVersion](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ObjectVersion/index.md) `files`) already contains the same list. Pass a
returned `File.file_ver` to
[DownloadFile_Begin](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectOperations/DownloadFile_Begin/index.md) to download the file.

A caller who cannot read the object gets "Access denied.".

<a id="request"></a>

## Request: GetObjectFilesRequest

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `obj_ver` | [`ObjVer`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ObjVer/index.md) | The object and a specific version of it. |
| `obj_ver.obj_id` | [`ObjID`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ObjID/index.md) | The object. |
| `obj_ver.obj_id.type` | `int32` | The object type ID, for example 0 for documents. In a lookup value, the value list ID (for a lookup to objects, the object type ID). |
| `obj_ver.obj_id.item_id` | [`ItemID`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ItemID/index.md) | The ID of the object within its type, in `item_id.internal_id`. |
| `obj_ver.version` | [`ObjVerVersion`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ObjVerVersion/index.md) | The version. Usually `OBJ_VER_VERSION_TYPE_SPECIFIC` with `internal_version`. |
| `obj_ver.version.type` | [`ObjVerVersionType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.ObjVerVersionType/index.md) | What `internal_version` means. `OBJ_VER_VERSION_TYPE_SPECIFIC` for a version number. Values: `OBJ_VER_VERSION_TYPE_UNINITIALIZED` (0), `OBJ_VER_VERSION_TYPE_LATEST` (1), `OBJ_VER_VERSION_TYPE_ANY` (2), `OBJ_VER_VERSION_TYPE_ALL` (3), `OBJ_VER_VERSION_TYPE_SPECIFIC` (4), `OBJ_VER_VERSION_TYPE_VALUE_LIST_ITEM` (6), `OBJ_VER_VERSION_TYPE_OBJECT_LEVEL_REFERENCE` (7). |
| `obj_ver.version.internal_version` | `int32` | The version number, starting from 1, when `type` is `OBJ_VER_VERSION_TYPE_SPECIFIC`. The server returns -1 with `OBJ_VER_VERSION_TYPE_LATEST`. |
| `obj_ver.version.external_repository_version` | `string` | Used only for objects in external repositories. Leave empty. |
| `obj_ver.version.external_repository_sort_key` | `int64` | Used only for objects in external repositories. Leave 0. |

<a id="response"></a>

## Response: GetObjectFilesResponse

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `files[]` | repeated [`File`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.File/index.md) | The files of the version, with their IDs, versions, sizes and MD5 checksums. |
| `files[].file_ver` | [`FileVer`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.FileVer/index.md) | The file and its version. Pass it unchanged in an `ObjFileVer` to download the file. |
| `files[].file_ver.file_id` | [`FileID`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.FileID/index.md) | The file. |
| `files[].file_ver.type` | [`FileVerType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.FileVerType/index.md) | `FILE_VER_TYPE_SPECIFIC` for a file version number. Values: `FILE_VER_TYPE_UNINITIALIZED` (0), `FILE_VER_TYPE_LATEST` (1), `FILE_VER_TYPE_ANY` (2), `FILE_VER_TYPE_SPECIFIC` (3). |
| `files[].file_ver.internal_version` | `int32` | The file version number. |
| `files[].file_ver.external_repository_version` | `string` | Used only for files in external repositories. Leave empty. |
| `files[].file_ver.external_repository_sort_key` | `int64` | Used only for files in external repositories. Leave 0. |
| `files[].title` | `string` | The file name without the extension. |
| `files[].extension` | `string` | The file name extension without the dot, for example "pdf". |
| `files[].size` | `int64` | The size of the file in bytes. Exact when `size_precision` is `FILE_SIZE_PRECISION_EXACT`. |
| `files[].size_precision` | [`FileSizePrecision`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.FileSizePrecision/index.md) | How exact `size` is. Do not rely on `size` if it is `FILE_SIZE_PRECISION_UNKNOWN`. Values: `FILE_SIZE_PRECISION_EXACT` (0), `FILE_SIZE_PRECISION_ESTIMATE` (1), `FILE_SIZE_PRECISION_UNKNOWN` (2). |
| `files[].created_at_utc` | [`google.protobuf.Timestamp`](https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp) | The time in UTC the file was originally created. |
| `files[].accessed_at_utc` | [`google.protobuf.Timestamp`](https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp) | The time in UTC the file was last accessed (e.g. read). |
| `files[].written_at_utc` | [`google.protobuf.Timestamp`](https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp) | The time in UTC the file was last written to. |
| `files[].changed_at_utc` | [`google.protobuf.Timestamp`](https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp) | The time in UTC the file was last written to or its attributes were changed. |
| `files[].guid` | `string` | GUID of the file. |
| `files[].md5_checksum` | `string` | The MD5 checksum of the file as 32 lowercase hexadecimal digits, if available. |
| `files[].is_missing` | `bool` | True, if the file is missing. |
| `files[].is_content_volatile` | `bool` | True, if the file physical content is volatile. I.e. the physical content can change without the version number change, as long as the logical content is same. The file content is guaranteed to stay physically consistent within single download session only. |
| `files[].flags` | [`OBJECTFILEFLAGS`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.OBJECTFILEFLAGS/index.md) | Object file flags. |
| `files[].flags.all` | `bool` | Specifies all flags set; Including any future flags. |
| `files[].flags.can_be_edited_externally` | `bool` | Next available value. |
| `files[].master_storage_file_ref` | `string` | An optional File reference (GUID) to external Master Storage API. Only used with Master Storage, otherwise empty. |

<a id="related"></a>

## Related methods

- [DownloadFile_Begin](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectOperations/DownloadFile_Begin/index.md): Opens a download session for a file version and returns its ID, the content size and, on request, its MD5 checksum.
- [GetObjectFilesForModificationInEventHandler](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectOperations/GetObjectFilesForModificationInEventHandler/index.md): Gets the files of a checked-out object version for modification by an event handler. Used by server-side vault applications; requires the vault-level right to edit and delete all objects.
