# WOPI operations (anonymous) (IRPCWOPIOperationsPublic)

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Server integration API](https://developer.m-files.com/APIs/gRPC-API/integration/index.md)

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

File, lock and session operations for Office for the web (WOPI), authorized by a WOPI access token
instead of an M-Files session.

- **gRPC service:** `MFiles.IRPCWOPIOperationsPublic`
- **Book and level:** [Server integration API](https://developer.m-files.com/APIs/gRPC-API/integration/index.md), specialized
- **Methods:** 15
- **Proto file:** [`mfiles/IRPCWOPIOperationsPublic.proto`](https://developer.m-files.com/APIs/gRPC-API/downloads/proto/mfiles/IRPCWOPIOperationsPublic.proto)

<a id="overview"></a>

## Overview

**For M-Files components only.** The M-Files WOPI service, the WOPI host that Office for the web
and the Office mobile apps talk to, calls these methods with the access token it received from
Office. M-Files Web also calls a few of them. Applications should not call this service.

- **No session.** Every method is called without `mfiles-session-id-bin`. The token in the
  request names the vault (it holds the vault GUID) and maps to the M-Files session that created
  it with [CreateWOPIUserSession](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperations/CreateWOPIUserSession/index.md) or
  [CreateContainerAccessToken](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperations/CreateContainerAccessToken/index.md). The
  method then runs in that session, with that user's permissions; it fails with access denied
  when the token is malformed, unknown or expired, or when that session has ended.
- **Token kinds:** a WOPI user session token (most methods), a one-time token (only
  [GetWOPIUserSessionKey](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/GetWOPIUserSessionKey/index.md)), and a
  container access token ([GetContainerInfo](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/GetContainerInfo/index.md),
  [GetContainerContent](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/GetContainerContent/index.md), and
  [GetWOPIUserSession](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/GetWOPIUserSession/index.md) with
  `WOPITOKEN_TYPE_WOPICONTAINER_TOKEN`).
- **Tasks:**
  - Open the editor: [GetWOPIUserSessionKey](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/GetWOPIUserSessionKey/index.md)
    (M-Files Web exchanges a one-time token from the URL) and
    [GetWOPIUserSession](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/GetWOPIUserSession/index.md).
  - File content: [WOPIDownloadFile_Begin](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/WOPIDownloadFile_Begin/index.md),
    [WOPIDownloadFile_ReadBlock](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/WOPIDownloadFile_ReadBlock/index.md),
    [WOPIUploadFile](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/WOPIUploadFile/index.md),
    [WOPIUploadFileCommit](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/WOPIUploadFileCommit/index.md).
  - WOPI locks: [GetLockForWOPI](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/GetLockForWOPI/index.md),
    [SetLockForWOPI](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/SetLockForWOPI/index.md),
    [RemoveLockForWOPI](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/RemoveLockForWOPI/index.md).
  - Check-out and check-in: [WOPIFileCheckOut](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/WOPIFileCheckOut/index.md),
    [WOPIFileCheckIn](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/WOPIFileCheckIn/index.md).
  - Co-authoring: [GetActiveParticipants](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/GetActiveParticipants/index.md).
  - End: [EndWOPIUserSession](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/EndWOPIUserSession/index.md).
  - Office mobile apps browsing: [GetContainerInfo](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/GetContainerInfo/index.md),
    [GetContainerContent](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/GetContainerContent/index.md).
- **Errors:** invalid tokens fail with plain "Access denied." (0x800407E4); a token
  for a vault that does not exist on the server answers after a delay of about 0.5 s.
- **Cloud:** an M-Files Cloud server answers these methods anonymously (a made-up token fails
  with "Access denied.").

<a id="methods"></a>

## Methods

| Method | Summary | Facts |
|---|---|---|
| [EndWOPIUserSession](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/EndWOPIUserSession/index.md) | Ends a WOPI user session: its token stops working at once. | `internal: not for applications` `write` `no session` |
| [GetActiveParticipants](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/GetActiveParticipants/index.md) | Lists the other users who currently have an open co-authoring session on the same file. | `internal: not for applications` `write` `no session` |
| [GetContainerContent](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/GetContainerContent/index.md) | Lists the subcontainers and files of the vault location (container) of a container access token. | `internal: not for applications` `write` `no session` |
| [GetContainerInfo](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/GetContainerInfo/index.md) | Gets the name and path of the vault location (container) of a container access token. | `internal: not for applications` `write` `no session` |
| [GetLockForWOPI](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/GetLockForWOPI/index.md) | Gets the WOPI lock string of the file of a WOPI user session. | `internal: not for applications` `write` `no session` |
| [GetWOPIUserSession](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/GetWOPIUserSession/index.md) | Gets the details of a WOPI user session: the shared object and file version, the action, the user and whether editing is allowed. | `internal: not for applications` `write` `no session` |
| [GetWOPIUserSessionKey](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/GetWOPIUserSessionKey/index.md) | Exchanges a one-time token for the WOPI user session token it stands for. | `internal: not for applications` `write` `no session` |
| [RemoveLockForWOPI](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/RemoveLockForWOPI/index.md) | Removes the WOPI lock string of the file of a WOPI user session. | `internal: not for applications` `write` `no session` |
| [SetLockForWOPI](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/SetLockForWOPI/index.md) | Sets the WOPI lock string of the file of a WOPI user session. | `internal: not for applications` `write` `no session` |
| [WOPIDownloadFile_Begin](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/WOPIDownloadFile_Begin/index.md) | Starts downloading the file of a WOPI user session and returns its size and MD5 checksum. | `internal: not for applications` `write` `no session` |
| [WOPIDownloadFile_ReadBlock](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/WOPIDownloadFile_ReadBlock/index.md) | Reads a block of the file of a WOPI download session. | `internal: not for applications` `write` `no session` |
| [WOPIFileCheckIn](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/WOPIFileCheckIn/index.md) | Checks in the object of a WOPI user session. | `internal: not for applications` `write` `no session` |
| [WOPIFileCheckOut](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/WOPIFileCheckOut/index.md) | Checks out the object of a read-only WOPI user session and turns the session into an editing session. | `internal: not for applications` `write` `no session` |
| [WOPIUploadFile](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/WOPIUploadFile/index.md) | Uploads a block of the new content of the file of a WOPI editing or co-authoring session. | `internal: not for applications` `write` `no session` |
| [WOPIUploadFileCommit](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/WOPIUploadFileCommit/index.md) | Stores an upload made with WOPIUploadFile as the new content of the file of the WOPI session. | `internal: not for applications` `write` `no session` |
