WOPI discovery

WOPI discovery is a process which helps the WOPI server discover a WOPI client by requesting the discovery XML from an online office. WOPI hosts use the discovery XML to specify how to interact with the online office. The requests are sent to the https://documentserver/hosting/discovery address where the documentserver is the name of the server with the ONLYOFFICE Docs installed.

The action element of the discovery XML provides the important characteristics of the online office. This element represents:

  • available document operations in the online office,
  • supported file formats (extensions).
WOPI actions
Name Description
Renders a non-editable view of a document.
Allows users to edit a document.
Creates a new document using a blank file template appropriate to the file type and opens this file for editing in the online office.
Renders a non-editable view of a document that is optimized for embedding in a web page. This action is available starting from version 7.2.
Converts a document in a binary format (doc, ppt, xls) into a modern format (docx, pptx, xlsx) so that it can be edited in the online office.
Attributes
Name Description
requires The WOPI REST endpoints required to use the actions.
urlsrc The URL that you navigate to in order to invoke the action on a particular file.
Example
<action name="edit" ext="docx" requires="locks,update"
    urlsrc="https://word-edit.officeapps.live.com/we/wordeditorframe.aspx?
ui=en-us&thm=1&"/>

Discovery query parameters are the parameters that can be exposed by file storage in the urlsrc attribute to customize the editor behavior. For example, change a language, theme, or chat.

Parameters
Name Description Example
Indicates that the WOPI server includes the preferred UI language in the format described in [RFC1766]. en-us
Indicates that the WOPI server includes preferred data language in the format described in [RFC1766] for cases where the language can affect data calculation (in spreadsheet editor). en-us
Indicates that the WOPI server includes a value to designate the theme used. The current values are "1" to indicate a light-colored theme and "2" to indicate a dark-colored theme. 1
Indicates that the WOPI server includes the value "1" to load a view of the document that does not create or join a chat session. 1
Indicates that the output of the action will be embedded in a web page (true). true
Indicates that the WOPI server includes the WOPISrc value. It tells the WOPI client what URL to call back to when running WOPI operations on a file. This parameter is required. https://<host_address>/wopi/files/(file_id)
Parameters
Name Description Example
Indicates that the Nextcloud WOPI server includes the document language in the format described in [RFC1766]. This language is used when creating a new document with the editnew action. en-us

Please pay attention to the discovery.xml structure of the Collabora connectors. They open the editor via the MIME-type which is included in the app element of the following structure:

<app name="application/msword">
    <action default="true" ext="" name="edit" urlsrc="http://159.89.20.129:9980/loleaflet/ba528af/loleaflet.html?"/>
</app>

The app element like this:

<app name="Word" favIconUrl="http://localhost:8000/web-apps/apps/documenteditor/main/resources/img/favicon.ico">

is ignored by the Collabora connectors.