IRPCWOPIOperations.CreateWOPIUserSession
Server integration API / specialized internal: not for applications write session
Creates a WOPI user session for one file version and returns its token (or a one-time token that can be exchanged for it).
| Service | WOPI operations MFiles.IRPCWOPIOperations |
|---|---|
| gRPC method | /MFiles.IRPCWOPIOperations/CreateWOPIUserSession |
| HTTP (mf-http-grpc) | POST /grpc/v1/create-wopiuser-session |
| Request | CreateWOPIUserSessionRequest |
| Response | CreateWOPIUserSessionResponse |
| Book and level | Server integration API, specialized |
| Kind | write |
| Session | Required: the session ID from LogIn in the mfiles-session-id-bin metadata. |
| Idempotent | no |
| Returns metadata structure version | no |
| Streaming | none (unary) |
Remarks
For M-Files components only. M-Files Web and M-Files Desktop call it before they open a file in Office for the web. Applications should not call it.
- Requires a vault session. The caller needs read access to the object; for co-authoring of a checked-out object, also edit access.
- Creates an internal shared link for the file (
SHARED_LINK_TYPE_WOPIREADONLY,SHARED_LINK_TYPE_WOPIEDITorSHARED_LINK_TYPE_CO_AUTHORINGbyaction_type; co-authoring reuses an existing co-authoring link) and a WOPI user session that refers to it. - The WOPI user session expires 30 minutes after it was created or last used (the default; the server administrator can change it). A one-time token expires after 5 minutes and can be exchanged only once, with GetWOPIUserSessionKey.
- For
WOPIACTION_TYPE_VIEWof a checked-out object, the latest checked-in version is shared; an object that has never been checked in fails with access denied.
Request: CreateWOPIUserSessionRequest
Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.
| Field | Type | Description |
|---|---|---|
wopi_user_session | WOPIUserSession | 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; the URLs are validated). The other fields are ignored. |
wopi_user_session.wopi_user_session_key | string | The WOPI vault user session key. |
wopi_user_session.wopi_accesskey | string | The access of the shared file. |
wopi_user_session.action_type | WOPIActionType | The WOPI Action type.Values: WOPIACTION_TYPE_VIEW (0), WOPIACTION_TYPE_EDIT (1), WOPIACTION_TYPE_COAUTHORING (2). |
wopi_user_session.user_account_id | uint32 | The user ID. |
wopi_user_session.user_account_name | string | The user Account Name. |
wopi_user_session.external_username | string | The External user name. |
wopi_user_session.additional_data | WOPIClientAdditionalData | WOPI Client Additional data. |
wopi_user_session.additional_data.return_uri | string | The Return URL. |
wopi_user_session.additional_data.main_app_url | string | The Main Appp URL. |
wopi_user_session.additional_data.wopi_end_point | string | The WOPI Endpoint. |
wopi_user_session.additional_data.culture_identifier | string | The Culture identifier. |
wopi_user_session.additional_data.action_url | string | The action URL. |
wopi_user_session.additional_data.host_edit_url | string | The Host edit URL. |
wopi_user_session.obj_ver | ObjVer | The ObjVer of the object. |
wopi_user_session.obj_ver.obj_id | ObjID | The object. |
wopi_user_session.obj_ver.version | ObjVerVersion | The version. Usually OBJ_VER_VERSION_TYPE_SPECIFIC with internal_version. |
wopi_user_session.file_ver | FileVer | The FileVer of the object. |
wopi_user_session.file_ver.file_id | FileID | The file. |
wopi_user_session.file_ver.type | FileVerType | FILE_VER_TYPE_SPECIFIC for a file version number.Values: FILE_VER_TYPE_UNINITIALIZED (0), FILE_VER_TYPE_LATEST (1), FILE_VER_TYPE_ANY (2), FILE_VER_TYPE_SPECIFIC (3). |
wopi_user_session.file_ver.internal_version | int32 | The file version number. |
wopi_user_session.file_ver.external_repository_version | string | Used only for files in external repositories. Leave empty. |
wopi_user_session.file_ver.external_repository_sort_key | int64 | Used only for files in external repositories. Leave 0. |
wopi_user_session.is_shared_file | bool | Specifies the Shared file. |
wopi_user_session.is_coauthor | bool | Specifies the Co-authored file. |
wopi_user_session.csrftoken | string | The CSRF Token. |
wopi_user_session.onetimetoken | string | The One Time Token. |
wopi_user_session.is_edit_allowed | bool | Specifies whether the file can be edited or not. |
wopi_user_session.client_type | ClientType | The client type (user agent) identifier. |
type | WOPITokenType | WOPITOKEN_TYPE_WOPIVAULT_USER_SESSION_TOKEN (the default) returns the session token itself; WOPITOKEN_TYPE_ONE_TIME_TOKEN returns a one-time token, for passing in a URL. WOPITOKEN_TYPE_WOPICONTAINER_TOKEN is rejected.Values: WOPITOKEN_TYPE_WOPIVAULT_USER_SESSION_TOKEN (0), WOPITOKEN_TYPE_ONE_TIME_TOKEN (1), WOPITOKEN_TYPE_WOPICONTAINER_TOKEN (2). |
Response: CreateWOPIUserSessionResponse
Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.
| Field | Type | Description |
|---|---|---|
wopi_key | string | The token of the requested type. |
Related methods
- IRPCWOPIOperationsPublic.GetWOPIUserSessionKey -- Exchanges a one-time token for the WOPI user session token it stands for.