Objects, versions, properties and files (IRPCObjectOperations)

View as Markdown

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 serviceMFiles.IRPCObjectOperations
Book and levelVault API, core
Methods132
Proto filemfiles/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

MethodSummaryFacts
GetObjectInfoAndPropertiesGets 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
GetObjectVersionAndPropertiesOfMultipleObjectsGets 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
GetObjectDataOfMultipleObjectsGets 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
GetPropertiesGets the property values of one specific object version.read session or assertion idempotent returns metadata structure version
GetObjectFilesGets the files of a specific object version.write session or assertion returns metadata structure version
DownloadFile_BeginOpens 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_ReadBlockReads a block of a file from a download session.read session or assertion idempotent
DownloadFile_StopCloses a download session.read session or assertion idempotent
UploadTempFileUploads 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
UploadTempFileCommitCompletes an upload made with UploadTempFile.write session or assertion idempotent
AddObjectWithFilesCreates a new object, optionally with its files, and optionally checks it in.write session or assertion returns metadata structure version
AddObjectCreates a new object without files.write session or assertion returns metadata structure version
CheckOutChecks out one object.write session or assertion returns metadata structure version
CheckInChecks in one object.write session or assertion returns metadata structure version
UndoCheckoutUndoes the checkout of one object.write session or assertion returns metadata structure version
SetPropertiesAdds, replaces or removes property values of an object.write session or assertion returns metadata structure version
SetPropertiesMultipleIf 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
AddObjectFileAdds new document file to a document.write session or assertion returns metadata structure version
GetObjectHistoryLists the existing versions of an object, oldest first.read session or assertion idempotent returns metadata structure version
GetWorkflowStatesGets the states of the given workflow in the appropriate order.read session or assertion idempotent returns metadata structure version
GetWorkflowStatesAndTransitionsGets the states and transitions of the given workflow.read session or assertion idempotent returns metadata structure version
GetEffectivePermissionsGets the effective permissions of a document.read session or assertion idempotent returns metadata structure version
RemoveObjectRemoves one object i.e. marks it deleted.write session or assertion returns metadata structure version
UndeleteObjectUndeletes a previously removed object.write session or assertion returns metadata structure version
DestroyObjectPermanently destroys an object, or one version of it.write session or assertion returns metadata structure version

Other methods

MethodSummaryFacts
AddObjectWithFilesWithPropertyMetadataCreates 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
AddOrUpdateExternalObjectCreates, updates or deletes the object that mirrors an item of an external system, identified by its external ID.write session or assertion
AddSingleFileDocument_SingleStepCreates 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_SingleStep2Creates 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_SingleStep3Creates 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
AddStubObjectCreates 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
AddVersionTagAdds 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
ChangeSecurityChanges the security settings of an object.write session or assertion returns metadata structure version
CheckAccessChecks user's access to an object based on an ACL.read session or assertion idempotent returns metadata structure version
CheckInExternalChangesCreates 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
CheckInMultipleChecks in several objects in one call.write session or assertion returns metadata structure version
CheckOutMultipleChecks out several objects in one call.write session or assertion returns metadata structure version
ConvertToPDFConverts the specified object file to PDF format.write session or assertion returns metadata structure version
CopyConflictObjectAsNewVersionToBaseObjectResolves 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
CountObjectVersionsMatchingConditionsCounts the versions of an object that DestroyObjectVersionsByConditions would destroy with the same inputs, without destroying anything.write session or assertion returns metadata structure version
CreateNewObjectWithPropertyMetadataCreates a new object without files, storing metadata about each property value.write session or assertion returns metadata structure version
DemoteObjectsRemoves 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
DestroyObjectsPermanently destroys several objects with all their versions. Requires the vault-level right to destroy objects.write session or assertion returns metadata structure version
DestroyObjectVersionsPermanently destroys specific object versions.write session or assertion returns metadata structure version
DestroyObjectVersionsByConditionsDestroys the old versions of an object that match search conditions, and returns how many were destroyed.write session or assertion returns metadata structure version
DetectTextLanguageDetects the language of a plain text.write session or assertion returns metadata structure version
DownloadFileNot available over native gRPC: the server answers "Not implemented.". Used by the M-Files HTTP gateway.write session or assertion
DownloadFileWithDownloadIDNot available over native gRPC: the server answers "Not implemented.". Used by the M-Files HTTP gateway.write session or assertion
DownloadFileWithDownloadKeyNot available over native gRPC: the server answers "Not implemented.". Used by the M-Files HTTP gateway.write session or assertion
DownloadTempFileFromUpload_BeginOpens a download session for a committed upload, to read it back or as a PDF, without creating an object.read session or assertion idempotent
FindEmailDuplicatesFinds duplicate email objects in the vault.write session or assertion returns metadata structure version
FindFileDuplicatesFinds files in the vault with the same content as the given file version.write session or assertion returns metadata structure version
FindFileDuplicatesOfObjVerFinds files in the vault with the same content as the files of the given object version.write session or assertion returns metadata structure version
FindFilesByChecksumFinds file versions in the vault by MD5 checksum.write session or assertion returns metadata structure version
FindVaultDuplicatesFinds all groups of duplicate files in the vault.write session or assertion returns metadata structure version
FollowObjectStarts 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
GetAutomaticMetadataGets 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
GetComparisonUrlOfUploadedFileGets 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
GetDocEventSubscriptionsGets the caller's event subscriptions for an object.read session or assertion idempotent returns metadata structure version
GetDocumentComparisonEnabledTells whether document comparison is available in the vault.write session or assertion
GetDocumentComparisonUrlGets a URL of a page that shows the differences between two document files in the vault.write session or assertion
GetDocumentComparisonWithTempFileUrlGets 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
GetExternalEditingDetailsGets the information a client needs to open a file in an external editing system (SharePoint Embedded).read session or assertion idempotent
GetFileDownloadUrlNot available over native gRPC: the server answers "Not implemented.". Used by the M-Files HTTP gateway.write session or assertion
GetFileDownloadUrl2Not available over native gRPC: the server answers "Not implemented.". Used by the M-Files HTTP gateway.write session or assertion
GetFileMalwareInfoGets the malware scanning verdict of a file, as an advisory hint for a user interface.read session or assertion idempotent
GetFileSizeGets the size of a specific file version in bytes.write session or assertion returns metadata structure version
GetIdentitiesAndViewsOfMultipleUnmanagedReducedItemsGets 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
GetLatestFileVersionGets the latest version of a file and the object version it belongs to.read session or assertion idempotent returns metadata structure version
GetLatestObjectVersionGets the number and GUID of the latest version of an object.read session or assertion idempotent returns metadata structure version
GetLatestVersionCommentOfMultipleObjectsGets the latest version comment of several objects.read session or assertion idempotent returns metadata structure version
GetMultipleWorkflowStatesAndTransitionsGets the states and transitions of several workflows in one call, in a compressed binary form.read session or assertion idempotent returns metadata structure version
GetMultipleWorkflowStatesAndTransitionsWithRightsCheckGets 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
GetObjectFilesForModificationInEventHandlerGets 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
GetObjectGUIDGets the GUID of an object.write session or assertion returns metadata structure version
GetObjectHistory2Lists the existing versions of an object with their version information, oldest first.write session or assertion returns metadata structure version
GetObjectInfoGets the version information of one object without its property values.read session or assertion idempotent returns metadata structure version
GetObjectInfoAndPropertiesWithMetadataLike GetObjectInfoAndProperties, but each property value also carries its value metadata.write session or assertion returns metadata structure version
GetObjectsByExternalIdsFinds objects of one object type by their external IDs.read session or assertion idempotent
GetObjIDByGUIDGets the object ID of the object that has the given object GUID.read session or assertion idempotent returns metadata structure version
GetPromotedObjectsLists 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
GetPropertiesOfMultipleObjectsGets the property values of several specific object versions.read session or assertion idempotent returns metadata structure version
GetPropertyValueWithMetadataGets a property value and its metadata.read session or assertion idempotent
GetRelationshipsForObjectGets the objects that a specific object version refers to, or that refer to it.read session or assertion idempotent returns metadata structure version
GetRemoteRelationshipSourceInfoGets 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
GetRemoteRelationshipTargetInfoFinds 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
GetSecurityGets the permissions (ACL) of an object version.read session or assertion idempotent returns metadata structure version
GetSecurityOfMultipleObjectsGets the permissions (ACL) of several object versions, in the order of obj_vers.read session or assertion idempotent returns metadata structure version
GetStateTransitionSignatureSettingsGets the signature settings for a state transition.read session or assertion idempotent returns metadata structure version
GetTemplateObjectsForObjectTypeGets the template objects of an object type, with the Additional classes value of each.write session or assertion returns metadata structure version
GetTemplatesGets the templates of an object type, optionally only those of one class or matching keywords.write session or assertion returns metadata structure version
GetTextContentForFileGets the plain text content of a file version.read session or assertion idempotent returns metadata structure version
GetTextContentForFileWithFormatGets 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
GetTextContentForTemporaryFileGets the plain text content of a file uploaded with UploadTempFile.write session or assertion
GetVersionCommentHistoryGets the version comments of an object up to a given version, oldest first.read session or assertion idempotent returns metadata structure version
GetWorkflowsForClientGets all the workflows in a format suitable for client.read session or assertion idempotent returns metadata structure version
GetWorkflowStateHistoryGets the workflow state history of an object.read session or assertion idempotent
HasFileDuplicatesTells whether a file with the given content (checksum) already exists in the vault.write session or assertion returns metadata structure version
KeepUploadSessionAliveKeeps an upload from being removed for inactivity.write session or assertion idempotent
MigrateObjectMigrates a promoted object. Requires full control of the vault; used by migration tools.write session or assertion returns metadata structure version
MigrateObjectsMigrates and promotes objects. Requires full control of the vault; used by migration tools.write session or assertion returns metadata structure version
ModifyVersionTagsReplaces 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
PrepareFilePrepares a PDF rendition of a file version and reports its size, extension and timestamp.write session or assertion idempotent returns metadata structure version
PromoteUnmanagedObjectPromotes objects of an external repository (unmanaged objects) to managed M-Files objects by giving them metadata.write session or assertion returns metadata structure version
RelayMasterStorageOperationsRelays file or object operations to Master Storage. Internal to M-Files; not for applications.write session or assertion idempotent
RemoveFromRecentlyAccessedRemoves the specified objects from being shown in 'Recently Accessed by Me'.write session or assertion returns metadata structure version
RemoveObjectFileRemoves a file from a document.write session or assertion returns metadata structure version
RemoveObjectsMarks several objects deleted in one transaction.write session or assertion returns metadata structure version
RemovePropertyRemoves one property value from an object version.write session or assertion returns metadata structure version
RemoveUploadSessionRemoves an upload and its temporary file.write session or assertion idempotent
RenameObjectFileRenames a document file.write session or assertion returns metadata structure version
ResolveConflictResolves 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
ResolveManagedIDOfPromotedObjectGets the managed object ID of an object that had the given unmanaged ID before it was promoted.read session or assertion idempotent
RollbackRolls 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
SetDocEventSubscriptionsReplaces the caller's event subscriptions for an object.write session or assertion idempotent returns metadata structure version
SetExternalObjectIDSets the external ID of an object.write session or assertion returns metadata structure version
SetFavoritesMultipleAdds and removes objects from the favorites collection of the user.write session or assertion idempotent returns metadata structure version
SetObjectActiveClears the draft (pending-upload) flag on an object, leaving it checked out.write session or assertion
SetObjectGUIDSets 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
SetObjectLevelPropertySets a property that belongs to the object as a whole rather than to one version.write session or assertion idempotent returns metadata structure version
SetPropertiesWithMetadataAdds, replaces or removes property values of an object, also storing metadata about each value.write session or assertion returns metadata structure version
SetPropertiesWithMetadataAttributedToSets property values with metadata and records the change as made by a built-in agent user.write session or assertion returns metadata structure version
SetPropertyValueMetadataChanges the metadata of property values without changing the values.write session or assertion
SetTierMoves objects between storage tiers.write session or assertion
UndeleteObjectsRestores several deleted objects. Requires the vault-level right to undelete objects.write session or assertion returns metadata structure version
UndoCheckoutMultipleUndoes the check-out of several objects in one call.write session or assertion returns metadata structure version
UpdateMetadataInFileWrites the object's metadata into the properties embedded in its files (for formats that support it).write session or assertion returns metadata structure version
UpdateObjectModificationInfoOverwrites the creation and last modification information (who and when) of a checked-out object.write session or assertion returns metadata structure version
UpdatePropertySets one property value of an object version.write session or assertion returns metadata structure version
UploadExistingFilesCopies existing file versions into new uploads, for example to create a new object with a copy of a file.write session or assertion
UploadFileUploads a block of new content for an existing file of an object that is checked out to the caller.write session or assertion idempotent
UploadFileCommitCompletes an upload made with UploadFile and stores it as the new content of the file.write session or assertion returns metadata structure version