# WOPIUserSession

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

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

Struct for WOPI User Session information.

- **Full name:** `MFiles.WOPIUserSession`
- **Proto file:** [`mfiles/structs.proto`](https://developer.m-files.com/APIs/gRPC-API/downloads/proto/mfiles/structs.proto)

<a id="fields"></a>

## Fields

| Field | Type | Number | Description |
|---|---|---|---|
| <a id="f-wopi_user_session_key"></a>`wopi_user_session_key` | `string` | 1 | The WOPI vault user session key. |
| <a id="f-wopi_accesskey"></a>`wopi_accesskey` | `string` | 2 | The access of the shared file. |
| <a id="f-action_type"></a>`action_type` | [`WOPIActionType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.WOPIActionType/index.md) | 3 | The WOPI Action type. Values: `WOPIACTION_TYPE_VIEW` (0), `WOPIACTION_TYPE_EDIT` (1), `WOPIACTION_TYPE_COAUTHORING` (2). |
| <a id="f-user_account_id"></a>`user_account_id` | `uint32` | 4 | The user ID. |
| <a id="f-user_account_name"></a>`user_account_name` | `string` | 5 | The user Account Name. |
| <a id="f-external_username"></a>`external_username` | `string` | 6 | The External user name. |
| <a id="f-additional_data"></a>`additional_data` | [`WOPIClientAdditionalData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.WOPIClientAdditionalData/index.md) | 7 | WOPI Client Additional data. |
| <a id="f-obj_ver"></a>`obj_ver` | [`ObjVer`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ObjVer/index.md) | 8 | The ObjVer of the object. |
| <a id="f-file_ver"></a>`file_ver` | [`FileVer`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.FileVer/index.md) | 9 | The FileVer of the object. |
| <a id="f-is_shared_file"></a>`is_shared_file` | `bool` | 10 | Specifies the Shared file. |
| <a id="f-is_coauthor"></a>`is_coauthor` | `bool` | 11 | Specifies the Co-authored file. |
| <a id="f-csrftoken"></a>`csrftoken` | `string` | 12 | The CSRF Token. |
| <a id="f-onetimetoken"></a>`onetimetoken` | `string` | 13 | The One Time Token. |
| <a id="f-is_edit_allowed"></a>`is_edit_allowed` | `bool` | 14 | Specifies whether the file can be edited or not. |
| <a id="f-client_type"></a>`client_type` | [`ClientType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.ClientType/index.md) | 15 | The client type (user agent) identifier. |

<a id="used-by-methods"></a>

## Used by methods

- [IRPCWOPIOperations.CreateWOPIUserSession](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperations/CreateWOPIUserSession/index.md): Creates a WOPI user session for one file version and returns its token (or a one-time token that can be exchanged for it).
- [IRPCWOPIOperationsPublic.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.

<a id="used-in-fields"></a>

## Used in fields

- [`CreateWOPIUserSessionRequest.wopi_user_session`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperations/CreateWOPIUserSession/index.md#request): The file to open: `obj_ver`, `file_ver`, `action_type`, `user_account_id` (the session's own user ID), `external_username` (usually empty) and `additional_data` (the URLs and culture that the WOPI host passes on to Office for the web; th...
- [`GetWOPIUserSessionResponse.wopi_user_session`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/GetWOPIUserSession/index.md#response): The session. `is_edit_allowed` is false when the user's license is read-only, the user lacks edit access, the object is deleted or has no editable files, an older version is shared, or the object is checked out to someone else (except in...
