Objects, versions, properties and files (IRPCObjectOperations)
An interface for handling documents and files
Provides methods for adding, modifying and removing objects. Includes version control operations as well, such as checkout and check-in.
| gRPC service | MFiles.IRPCObjectOperations |
|---|---|
| Book and level | Vault API, core |
| Methods | 132 |
| Proto file | mfiles/IRPCObjectOperations.proto |
Overview
Everything you do with individual objects: read their versions, properties and files, create them, change them, and manage their lifecycle. To find objects in the first place, use SearchObjects.
| Job | Method |
|---|---|
| Read the latest version and properties of one or many objects | GetObjectVersionAndPropertiesOfMultipleObjects |
| Read one object, latest or a specific version | GetObjectInfoAndProperties |
| Read selected data (properties, ACL, permissions, relationships, comments) per object | GetObjectDataOfMultipleObjects |
| Read the properties of a known, specific version | GetProperties |
| Resolve the latest version number | GetLatestObjectVersion |
| List the versions of an object | GetObjectHistory |
| Download a file | DownloadFile_Begin, DownloadFile_ReadBlock |
| Get the text of a file (plain text or Markdown) | GetTextContentForFileWithFormat |
| Upload content for a new object | UploadTempFile, UploadTempFileCommit |
| Create an object, with or without files | AddObjectWithFiles, AddObject |
| Change properties | SetProperties, SetPropertiesMultiple |
| Check out, check in, undo a check-out | CheckOut, CheckIn, UndoCheckout |
| Add a file to an object | AddObjectFile |
| Workflow states and transitions | GetWorkflowStates, GetWorkflowStatesAndTransitions |
| What the caller may do with an object | GetEffectivePermissions |
| Delete, undelete, destroy | RemoveObject, UndeleteObject, DestroyObject |
The other methods are batch variants of the ones above (...Multiple), history and version
comments, duplicate detection (Find...Duplicates), objects from external repositories
(...External..., ...Promote..., ...Unmanaged...), and helpers for M-Files client features
such as document comparison and external editing.
Versions. Most read methods take an ObjVer and need a specific
version (OBJ_VER_VERSION_TYPE_SPECIFIC with internal_version). GetProperties,
GetPropertiesOfMultipleObjects, GetObjectFiles, GetRelationshipsForObject and
GetLatestVersionCommentOfMultipleObjects answer "Not found." to the OBJ_VER_VERSION_TYPE_LATEST
marker. To read the latest version, either use a method that has its own "latest" switch
(GetObjectVersionAndPropertiesOfMultipleObjects, GetObjectInfoAndProperties,
GetObjectDataOfMultipleObjects, GetObjectInfo), or resolve the number first with
GetLatestObjectVersion. The same applies to files: FileVer must name a
specific file version.
Checked-out objects. "Latest" means the latest checked-in version. A version that is
checked out is returned only to the user who has it checked out, and only where the request says
so (allow_checked_out, OBJECT_VERSION_DATA_REQUEST_VERSION_TYPE_LATEST_VERSIONS), except
GetObjectInfo, which always returns it to that user.
Creating objects: always set acl. AddObjectWithFiles, AddObject and the other creating
methods store the ACL you send; they do not compute one from the class. An unset acl gives the
new object an empty ACL: once it is checked in, only users with the vault-level right to see all
objects can see it, not even its creator. Send a named ACL, for example
acl { custom_component { has_named_acl: true named_acl_id: -1 } } ("Full control for all
internal users"); see AddObjectWithFiles.
Files. The object's version information (ObjectVersion
files) already lists its files with their file_ver, size and MD5 checksum, so after reading
an object you can download its files without calling GetObjectFiles. DownloadFile,
DownloadFileWithDownloadID, DownloadFileWithDownloadKey, GetFileDownloadUrl and
GetFileDownloadUrl2 serve the HTTP gateway and answer "Not implemented." over native gRPC.
Errors. Errors arrive with gRPC status UNKNOWN and the M-Files error message as the status
details. A missing object or version is "Not found." (0x8004000B). An object the caller is not
allowed to read is "Access denied." (0x800407E4) for most methods, but "Not found." for
GetObjectInfoAndProperties, and GetObjectHistory returns an empty list for it.
Background: Objects and versions, Properties and values, Permissions, Workflows and Files.
Highlighted methods
| Method | Summary | Facts |
|---|---|---|
| GetObjectInfoAndProperties | Gets the version information and the property values of one object, either its latest version or a specific version. | write session or assertion returns metadata structure version |
| GetObjectVersionAndPropertiesOfMultipleObjects | Gets the version information and the property values of several objects in one call. The preferred way to read objects. | read session or assertion idempotent returns metadata structure version |
| GetObjectDataOfMultipleObjects | Gets selected data of several objects: version information, properties, ACL, the caller's permissions, relationships, version comments and more, with a result or an error per object. | read session or assertion idempotent returns metadata structure version |
| GetProperties | Gets the property values of one specific object version. | read session or assertion idempotent returns metadata structure version |
| GetObjectFiles | Gets the files of a specific object version. | write session or assertion returns metadata structure version |
| DownloadFile_Begin | Opens a download session for a file version and returns its ID, the content size and, on request, its MD5 checksum. | read session or assertion idempotent returns metadata structure version |
| DownloadFile_ReadBlock | Reads a block of a file from a download session. | read session or assertion idempotent |
| DownloadFile_Stop | Closes a download session. | read session or assertion idempotent |
| UploadTempFile | Uploads a block of a file to a temporary upload session on the server. The upload can then be used as the content of a new object. | write session or assertion idempotent |
| UploadTempFileCommit | Completes an upload made with UploadTempFile. | write session or assertion idempotent |
| AddObjectWithFiles | Creates a new object, optionally with its files, and optionally checks it in. | write session or assertion returns metadata structure version |
| AddObject | Creates a new object without files. | write session or assertion returns metadata structure version |
| CheckOut | Checks out one object. | write session or assertion returns metadata structure version |
| CheckIn | Checks in one object. | write session or assertion returns metadata structure version |
| UndoCheckout | Undoes the checkout of one object. | write session or assertion returns metadata structure version |
| SetProperties | Adds, replaces or removes property values of an object. | write session or assertion returns metadata structure version |
| SetPropertiesMultiple | If the object is currently checked in, a new checked-in version is created. If the object is currently checked out, the changes are applied to the checked-out version. | write session or assertion returns metadata structure version |
| AddObjectFile | Adds new document file to a document. | write session or assertion returns metadata structure version |
| GetObjectHistory | Lists the existing versions of an object, oldest first. | read session or assertion idempotent returns metadata structure version |
| GetWorkflowStates | Gets the states of the given workflow in the appropriate order. | read session or assertion idempotent returns metadata structure version |
| GetWorkflowStatesAndTransitions | Gets the states and transitions of the given workflow. | read session or assertion idempotent returns metadata structure version |
| GetEffectivePermissions | Gets the effective permissions of a document. | read session or assertion idempotent returns metadata structure version |
| RemoveObject | Removes one object i.e. marks it deleted. | write session or assertion returns metadata structure version |
| UndeleteObject | Undeletes a previously removed object. | write session or assertion returns metadata structure version |
| DestroyObject | Permanently destroys an object, or one version of it. | write session or assertion returns metadata structure version |
Other methods
| Method | Summary | Facts |
|---|---|---|
| AddObjectWithFilesWithPropertyMetadata | Creates a new object with files, storing metadata about each property value (who or what set it, why, and with what confidence). | write session or assertion returns metadata structure version |
| AddOrUpdateExternalObject | Creates, updates or deletes the object that mirrors an item of an external system, identified by its external ID. | write session or assertion |
| AddSingleFileDocument_SingleStep | Creates a single-file document from inline file content and checks it in. Older form; prefer AddObjectWithFiles with an inline file source. | write session or assertion returns metadata structure version |
| AddSingleFileDocument_SingleStep2 | Creates a single-file document from inline file content. Older form; prefer AddObjectWithFiles with an inline file source. | write session or assertion returns metadata structure version |
| AddSingleFileDocument_SingleStep3 | Creates a single-file document from inline file content and returns its file version. Older form; prefer AddObjectWithFiles with an inline file source. | write session or assertion returns metadata structure version |
| AddStubObject | Creates a stub object that stands for an object in another vault. Used by replication and cross-vault relationships; not for applications. | write session or assertion returns metadata structure version |
| AddVersionTag | Adds the specified tag to the document version. If the tag already exists in the specified target version, this method does nothing. Other tags are not affected. | write session or assertion idempotent returns metadata structure version |
| ChangeSecurity | Changes the security settings of an object. | write session or assertion returns metadata structure version |
| CheckAccess | Checks user's access to an object based on an ACL. | read session or assertion idempotent returns metadata structure version |
| CheckInExternalChanges | Creates new versions of objects whose files were changed in an external editing system (SharePoint Embedded co-authoring). No version is created for an object without changes. | write session or assertion returns metadata structure version |
| CheckInMultiple | Checks in several objects in one call. | write session or assertion returns metadata structure version |
| CheckOutMultiple | Checks out several objects in one call. | write session or assertion returns metadata structure version |
| ConvertToPDF | Converts the specified object file to PDF format. | write session or assertion returns metadata structure version |
| CopyConflictObjectAsNewVersionToBaseObject | Resolves a replication conflict by adding the conflict object's content as a new version of the base object. Used by M-Files clients; not for applications. | write session or assertion returns metadata structure version |
| CountObjectVersionsMatchingConditions | Counts the versions of an object that DestroyObjectVersionsByConditions would destroy with the same inputs, without destroying anything. | write session or assertion returns metadata structure version |
| CreateNewObjectWithPropertyMetadata | Creates a new object without files, storing metadata about each property value. | write session or assertion returns metadata structure version |
| DemoteObjects | Removes the M-Files metadata from promoted objects, turning them back into unmanaged objects of their external repository. | write session or assertion returns metadata structure version |
| DestroyObjects | Permanently destroys several objects with all their versions. Requires the vault-level right to destroy objects. | write session or assertion returns metadata structure version |
| DestroyObjectVersions | Permanently destroys specific object versions. | write session or assertion returns metadata structure version |
| DestroyObjectVersionsByConditions | Destroys the old versions of an object that match search conditions, and returns how many were destroyed. | write session or assertion returns metadata structure version |
| DetectTextLanguage | Detects the language of a plain text. | write session or assertion returns metadata structure version |
| DownloadFile | Not available over native gRPC: the server answers "Not implemented.". Used by the M-Files HTTP gateway. | write session or assertion |
| DownloadFileWithDownloadID | Not available over native gRPC: the server answers "Not implemented.". Used by the M-Files HTTP gateway. | write session or assertion |
| DownloadFileWithDownloadKey | Not available over native gRPC: the server answers "Not implemented.". Used by the M-Files HTTP gateway. | write session or assertion |
| DownloadTempFileFromUpload_Begin | Opens a download session for a committed upload, to read it back or as a PDF, without creating an object. | read session or assertion idempotent |
| FindEmailDuplicates | Finds duplicate email objects in the vault. | write session or assertion returns metadata structure version |
| FindFileDuplicates | Finds files in the vault with the same content as the given file version. | write session or assertion returns metadata structure version |
| FindFileDuplicatesOfObjVer | Finds files in the vault with the same content as the files of the given object version. | write session or assertion returns metadata structure version |
| FindFilesByChecksum | Finds file versions in the vault by MD5 checksum. | write session or assertion returns metadata structure version |
| FindVaultDuplicates | Finds all groups of duplicate files in the vault. | write session or assertion returns metadata structure version |
| FollowObject | Starts or stops following the specified object. While the object is being followed, the current user will be notified if the object changes. | write session or assertion returns metadata structure version |
| GetAutomaticMetadata | Gets automatic metadata from the vault's metadata providers, for an object about to be created (from its uploaded files) or for an existing object version. | read session or assertion idempotent returns metadata structure version |
| GetComparisonUrlOfUploadedFile | Gets a URL of a page that shows the differences between a document file in the vault and a stateless upload identified by its file_ref. | write session or assertion |
| GetDocEventSubscriptions | Gets the caller's event subscriptions for an object. | read session or assertion idempotent returns metadata structure version |
| GetDocumentComparisonEnabled | Tells whether document comparison is available in the vault. | write session or assertion |
| GetDocumentComparisonUrl | Gets a URL of a page that shows the differences between two document files in the vault. | write session or assertion |
| GetDocumentComparisonWithTempFileUrl | Gets a URL of a page that shows the differences between a document file in the vault and an uploaded temporary file. | write session or assertion |
| GetExternalEditingDetails | Gets the information a client needs to open a file in an external editing system (SharePoint Embedded). | read session or assertion idempotent |
| GetFileDownloadUrl | Not available over native gRPC: the server answers "Not implemented.". Used by the M-Files HTTP gateway. | write session or assertion |
| GetFileDownloadUrl2 | Not available over native gRPC: the server answers "Not implemented.". Used by the M-Files HTTP gateway. | write session or assertion |
| GetFileMalwareInfo | Gets the malware scanning verdict of a file, as an advisory hint for a user interface. | read session or assertion idempotent |
| GetFileSize | Gets the size of a specific file version in bytes. | write session or assertion returns metadata structure version |
| GetIdentitiesAndViewsOfMultipleUnmanagedReducedItems | Gets the identities and view IDs of unmanaged items of an external repository. Used by M-Files clients; not for applications. | read session or assertion idempotent returns metadata structure version |
| GetLatestFileVersion | Gets the latest version of a file and the object version it belongs to. | read session or assertion idempotent returns metadata structure version |
| GetLatestObjectVersion | Gets the number and GUID of the latest version of an object. | read session or assertion idempotent returns metadata structure version |
| GetLatestVersionCommentOfMultipleObjects | Gets the latest version comment of several objects. | read session or assertion idempotent returns metadata structure version |
| GetMultipleWorkflowStatesAndTransitions | Gets the states and transitions of several workflows in one call, in a compressed binary form. | read session or assertion idempotent returns metadata structure version |
| GetMultipleWorkflowStatesAndTransitionsWithRightsCheck | Gets the states and transitions of several workflows in one call, in a compressed binary form, with the user's rights checked. | read session or assertion idempotent returns metadata structure version |
| GetObjectFilesForModificationInEventHandler | 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. | write session or assertion returns metadata structure version |
| GetObjectGUID | Gets the GUID of an object. | write session or assertion returns metadata structure version |
| GetObjectHistory2 | Lists the existing versions of an object with their version information, oldest first. | write session or assertion returns metadata structure version |
| GetObjectInfo | Gets the version information of one object without its property values. | read session or assertion idempotent returns metadata structure version |
| GetObjectInfoAndPropertiesWithMetadata | Like GetObjectInfoAndProperties, but each property value also carries its value metadata. | write session or assertion returns metadata structure version |
| GetObjectsByExternalIds | Finds objects of one object type by their external IDs. | read session or assertion idempotent |
| GetObjIDByGUID | Gets the object ID of the object that has the given object GUID. | read session or assertion idempotent returns metadata structure version |
| GetPromotedObjects | Lists promoted objects of an external repository. Requires full control of the vault; the maximum result count must be 1 to 1000. | write session or assertion returns metadata structure version |
| GetPropertiesOfMultipleObjects | Gets the property values of several specific object versions. | read session or assertion idempotent returns metadata structure version |
| GetPropertyValueWithMetadata | Gets a property value and its metadata. | read session or assertion idempotent |
| GetRelationshipsForObject | Gets the objects that a specific object version refers to, or that refer to it. | read session or assertion idempotent returns metadata structure version |
| GetRemoteRelationshipSourceInfo | Gets what another vault needs to create a stub of this object, or to find a matching object. Used by replication and cross-vault relationships; not for applications. | read session or assertion idempotent returns metadata structure version |
| GetRemoteRelationshipTargetInfo | Finds the local object that matches an object of another vault, or the information for creating a stub of it. Used by replication and cross-vault relationships; not for applications. | read session or assertion idempotent returns metadata structure version |
| GetSecurity | Gets the permissions (ACL) of an object version. | read session or assertion idempotent returns metadata structure version |
| GetSecurityOfMultipleObjects | Gets the permissions (ACL) of several object versions, in the order of obj_vers. | read session or assertion idempotent returns metadata structure version |
| GetStateTransitionSignatureSettings | Gets the signature settings for a state transition. | read session or assertion idempotent returns metadata structure version |
| GetTemplateObjectsForObjectType | Gets the template objects of an object type, with the Additional classes value of each. | write session or assertion returns metadata structure version |
| GetTemplates | Gets the templates of an object type, optionally only those of one class or matching keywords. | write session or assertion returns metadata structure version |
| GetTextContentForFile | Gets the plain text content of a file version. | read session or assertion idempotent returns metadata structure version |
| GetTextContentForFileWithFormat | Gets the text content of a file version as plain text or Markdown, and reports which format was produced. | read session or assertion idempotent returns metadata structure version |
| GetTextContentForTemporaryFile | Gets the plain text content of a file uploaded with UploadTempFile. | write session or assertion |
| GetVersionCommentHistory | Gets the version comments of an object up to a given version, oldest first. | read session or assertion idempotent returns metadata structure version |
| GetWorkflowsForClient | Gets all the workflows in a format suitable for client. | read session or assertion idempotent returns metadata structure version |
| GetWorkflowStateHistory | Gets the workflow state history of an object. | read session or assertion idempotent |
| HasFileDuplicates | Tells whether a file with the given content (checksum) already exists in the vault. | write session or assertion returns metadata structure version |
| KeepUploadSessionAlive | Keeps an upload from being removed for inactivity. | write session or assertion idempotent |
| MigrateObject | Migrates a promoted object. Requires full control of the vault; used by migration tools. | write session or assertion returns metadata structure version |
| MigrateObjects | Migrates and promotes objects. Requires full control of the vault; used by migration tools. | write session or assertion returns metadata structure version |
| ModifyVersionTags | Replaces the version tags of an object version with the given set; an empty tags clears them. | write session or assertion idempotent returns metadata structure version |
| PrepareFile | Prepares a PDF rendition of a file version and reports its size, extension and timestamp. | write session or assertion idempotent returns metadata structure version |
| PromoteUnmanagedObject | Promotes objects of an external repository (unmanaged objects) to managed M-Files objects by giving them metadata. | write session or assertion returns metadata structure version |
| RelayMasterStorageOperations | Relays file or object operations to Master Storage. Internal to M-Files; not for applications. | write session or assertion idempotent |
| RemoveFromRecentlyAccessed | Removes the specified objects from being shown in 'Recently Accessed by Me'. | write session or assertion returns metadata structure version |
| RemoveObjectFile | Removes a file from a document. | write session or assertion returns metadata structure version |
| RemoveObjects | Marks several objects deleted in one transaction. | write session or assertion returns metadata structure version |
| RemoveProperty | Removes one property value from an object version. | write session or assertion returns metadata structure version |
| RemoveUploadSession | Removes an upload and its temporary file. | write session or assertion idempotent |
| RenameObjectFile | Renames a document file. | write session or assertion returns metadata structure version |
| ResolveConflict | Resolves a replication conflict between an object and its conflict object. Used by replication tools and M-Files clients; not for applications. | write session or assertion returns metadata structure version |
| ResolveManagedIDOfPromotedObject | Gets the managed object ID of an object that had the given unmanaged ID before it was promoted. | read session or assertion idempotent |
| Rollback | Rolls back to an older version. Creates a new version that is a copy of the specified old version. | write session or assertion returns metadata structure version |
| SetDocEventSubscriptions | Replaces the caller's event subscriptions for an object. | write session or assertion idempotent returns metadata structure version |
| SetExternalObjectID | Sets the external ID of an object. | write session or assertion returns metadata structure version |
| SetFavoritesMultiple | Adds and removes objects from the favorites collection of the user. | write session or assertion idempotent returns metadata structure version |
| SetObjectActive | Clears the draft (pending-upload) flag on an object, leaving it checked out. | write session or assertion |
| SetObjectGUID | Sets the Object GUID of the specified object. NOTE: In general, the identity of an object should remain unchanged. Use this method in special circumstances only. | write session or assertion returns metadata structure version |
| SetObjectLevelProperty | Sets a property that belongs to the object as a whole rather than to one version. | write session or assertion idempotent returns metadata structure version |
| SetPropertiesWithMetadata | Adds, replaces or removes property values of an object, also storing metadata about each value. | write session or assertion returns metadata structure version |
| SetPropertiesWithMetadataAttributedTo | Sets property values with metadata and records the change as made by a built-in agent user. | write session or assertion returns metadata structure version |
| SetPropertyValueMetadata | Changes the metadata of property values without changing the values. | write session or assertion |
| SetTier | Moves objects between storage tiers. | write session or assertion |
| UndeleteObjects | Restores several deleted objects. Requires the vault-level right to undelete objects. | write session or assertion returns metadata structure version |
| UndoCheckoutMultiple | Undoes the check-out of several objects in one call. | write session or assertion returns metadata structure version |
| UpdateMetadataInFile | Writes the object's metadata into the properties embedded in its files (for formats that support it). | write session or assertion returns metadata structure version |
| UpdateObjectModificationInfo | Overwrites the creation and last modification information (who and when) of a checked-out object. | write session or assertion returns metadata structure version |
| UpdateProperty | Sets one property value of an object version. | write session or assertion returns metadata structure version |
| UploadExistingFiles | Copies existing file versions into new uploads, for example to create a new object with a copy of a file. | write session or assertion |
| UploadFile | Uploads a block of new content for an existing file of an object that is checked out to the caller. | write session or assertion idempotent |
| UploadFileCommit | Completes an upload made with UploadFile and stores it as the new content of the file. | write session or assertion returns metadata structure version |