跳到主要内容

CheckFileInfo

GET /wopi/files/(file_id)

The CheckFileInfo operation must be implemented for all WOPI actions. This operation returns information about a file, a user's permissions on that file, and general information about the capabilities that the WOPI host has on the file. Also, some CheckFileInfo properties can influence the appearance and behavior of WOPI clients.

Parameters

NameTypeDescription
file_idstringThe ID of a file managed by the host. This string must be URL safe.

Query parameters

NameTypeDescription
access_tokenstringAn access token that the host uses to determine whether the request is authorized.

Request headers

NameTypePresenceDescription
X-WOPI-SessionContextstringoptionalSession context if it is provided on the initial WOPI action URL.

Required response properties

Please note that the default value for any response string value is the empty string.

NameTypeExampleDescription
BaseFileNamestring"Example File Name.docx"A name of the file, including extension, without a path. Used for display in user interface (UI), and determining the extension of the file.
Versionstring"Khirz6zTPdfd7"The current version of the file based on the server's file version schema. This value must change when the file changes, and version values must never repeat for a given file.
NameTypeExampleDescription
BreadcrumbBrandNamestring"Example Brand Name"The brand name of the host.
BreadcrumbBrandUrlstringhttps://example.com/url-to-breadcrumb-brand-page.comA URI to a web page that the WOPI client should navigate to when the user clicks on UI that displays BreadcrumbBrandName.
BreadcrumbDocNamestring"Example Breadcrumb File Name.docx"A file name that the WOPI client displays to the user. If this parameter is not specified, then the BaseFileName parameter is used.
BreadcrumbFolderNamestring"Example Folder Name"The name of the container that contains the file.
BreadcrumbFolderUrlstringhttps://example.com/url-to-breadcrumb-brand-folderA URI to a web page that the WOPI client should navigate to when the user clicks on UI that displays BreadcrumbFolderName.

PostMessage properties

NameTypeExampleDescription
ClosePostMessagebooleantrueSpecifies if the host expects to receive the UI_Close PostMessage when the Close UI in the online office is activated.
EditModePostMessagebooleantrueSpecifies if the host expects to receive the UI_Edit PostMessage when the Edit UI in the online office is activated. If this property is not set to true, the online office navigates the inner iframe URL to an edit action URL when the Edit UI is activated.
EditNotificationPostMessagebooleantrueSpecifies if the host expects to receive the Edit_Notification PostMessage.
FileSharingPostMessagebooleantrueSpecifies if the host expects to receive the UI_Sharing PostMessage when the Share UI in the online office is activated.
FileVersionPostMessagebooleantrueSpecifies if the host expects to receive the UI_FileVersions PostMessage when the Previous Versions UI in the online office is activated.
PostMessageOriginstringhttps://exampledomain.comA domain that the host page is sending and receiving PostMessages to and from. The online office only sends outgoing PostMessages to this domain, and only listens to PostMessages from this domain.

File URL properties

NameTypeExampleDescription
CloseUrlstringhttps://example.com/url-to-close-page.comA URI to a web page that the WOPI client should navigate to when the application closes, or in the event of an unrecoverable error.
FileSharingUrlstringhttps://example.com/url-to-sharing-page.comA URI to a location that allows the user to share the file.
FileVersionUrlstringhttps://example.com/url-to-previous-version-page.comA URI to a location that lets the user view the version history for the file.
HostEditUrlstringhttps://example.com/url-to-host-page.comA URI to a host page that loads the edit WOPI action.

Other miscellaneous properties

NameTypeExampleDescription
CopyPasteRestrictionsstring"BlockAll"Specifies if the WOPI client should disable the Copy and Paste functionality within the application. By default, all Copy and Paste functionality is enabled, i.e. the setting has no effect. Possible property values:

- BlockAll - the Copy and Paste functionality is completely disabled within the application;

- CurrentDocumentOnly - the Copy and Paste functionality is enabled but content can only be copied and pasted within the file currently open in the application.
DisablePrintbooleantrueSpecifies if the WOPI client should disable all print functionality.
FileExtensionstring".docx"A file extension which must begin with a ".". If provided, WOPI clients will use this value as the file extension. Otherwise the extension will be parsed from the BaseFileName.
FileNameMaxLengthinteger20The maximum length for file names that the WOPI host supports, excluding the file extension. The default value is 250. Note that WOPI clients will use this default value if the property is omitted or if it is explicitly set to 0.
LastModifiedTimestring"2009-06-15T13:45:30.0000000Z"The last time that the file was modified. This time must always be a UTC time, and must be formatted in ISO 8601 round-trip format. This property can be specified as an alternative to the Version property.

User metadata properties

NameTypeExampleDescription
IsAnonymousUserbooleantrueSpecifies if the user is authenticated with the host or not. Hosts should always set this to true for unauthenticated users, so that clients are aware that the user is anonymous.
UserFriendlyNamestring"John Smith"The name of the user, suitable for displaying in UI.
UserIdstring"uid-1"A value uniquely identifying the user currently accessing the file.

User permissions properties

NameTypeExampleDescription
ReadOnlybooleantrueSpecifies if a file cannot be changed by the current user.
UserCanNotWriteRelativebooleanfalseSpecifies if the user has sufficient permission to create new files on the WOPI server. The true value means that the PutRelativeFile execution will fail for this user on the current file. By default, this parameter is false and the PutRelativeFile operation is executed.
UserCanRenamebooleantrueSpecifies if the user has permissions to rename the current file.
UserCanReviewbooleantrueSpecifies if the user has permissions to review the current file.
UserCanWritebooleantrueSpecifies if the user has permissions to alter the file.

WOPI host capabilities properties

NameTypeExampleDescription
SupportsLocksbooleantrueSpecifies if the host supports the Lock, Unlock, and RefreshLock operations.
SupportsRenamebooleantrueSpecifies if the WOPI server supports the renaming permission.
SupportsReviewingbooleantrueSpecifies if the host supports the review permission.
SupportsUpdatebooleantrueSpecifies if the host supports the PutFile and PutRelativeFile operations.

Nextcloud/Collabora/Seafile properties

NameTypeExampleDescription
EnableInsertRemoteImagebooleantrueSpecifies whether to enable the menu entry and toolbar item which call the UI_InsertGraphic message. This property is used to display a user interface element (for example, a dialog) allowing the user to pick an image from the integration. The integration is supposed to provide a temporary URL that may be downloaded once, and return it back via the Action_InsertGraphic message with Values set to the temporary URL.
HidePrintOptionbooleanfalseSpecifies if the WOPI server hides the print option from the file menu bar in the UI.