The M-Files COM/.NET API can be used from any software that can interact with COM. This is our most comprehensive API and provides interfaces for most “user” and “administrative” functions. The API is available on both 32-bit and 64-bit versions and is typically referenced from your code by adding a reference to it within Visual Studio:

Adding a reference to the COM API

The API can be used to create almost any solution that retrieve or process information within an M-Files vault, such as:

  • Retrieving content from M-Files and display it within another application (e.g. to retrieve customer documents to display within a CRM),
  • Creating objects within M-Files (e.g. to create an Order object when a user completes payment online),
  • Moving objects through a workflow as required (e.g. when an electronically-signed version of a document is received, move the contract to another state).

The COM API requires the same version of the API on the client machine as the server (e.g. if communicating with an M-Files 2015.3 server, the API must also be of the same version).

API modes (client vs. server)

The primary focus of creating a connection to the server is to retrieve a Vault object. The Vault object can then be used to query content from the vault, or to process it in some manner.

The API can be used in either “server” or “client” mode. Some API methods are only available in one of the modes.

  • A connection in client mode is designed to be used in situations where both the user is present, and a connection to the vault has been created in the M-Files Desktop Settings. In client mode, built-in M-Files dialogs (e.g. the “create new object” metadata card) can be shown to the user for them to interact with.

  • A connection in server mode is designed to be used in situations where the user is not necessarily present, and/or a connection to the vault has not been created in the M-Files Desktop Settings. In server mode, dialogs cannot be shown and the code must programmatically undertake these actions. The server mode allows connections to M-Files servers using the standard protocols – TCP/IP, HTTPS, and LPC – and supports all the same authentication schemes that M-Files supports.

Common API objects

User operations

For finding the vault structure:

For finding objects:

More information on searching for objects can be found in the dedicated pages.

For working with objects (finding properties, checking in and out, manipulating files, etc.)

Administrative operations

For working with the vault structure: