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.

WOPI discovery actions

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

NameDescription
viewRenders a non-editable view of a document.
editAllows users to edit a document.
editnewCreates a new document using a blank file template appropriate to the file type and opens this file for editing in the online office.
embedviewRenders 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.
convertConverts 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. This action is available starting from version 7.3.
formsubmitSupports opening pdf files in the form filling mode. In this case, a user might be able to make changes to a pdf file even if they didn't have permission to use the edit action. This action is available starting from version 8.1.
mobileViewRenders a non-editable view of a document that is optimized for viewing on mobile devices such as smartphones. This action is available starting from version 7.4.

Attributes

NameDescription
requiresThe WOPI REST endpoints required to use the actions.
urlsrcThe 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&amp;thm=1&amp;"/>

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.

WOPI standard

Parameters

NameExampleDescription
uien-usIndicates that the WOPI server includes the preferred UI language in the format described in [RFC1766].
rsen-usIndicates 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).
thm1Indicates 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.
dchat1Indicates that the WOPI server includes the value "1" to load a view of the document that does not create or join a chat session.
embedtrueIndicates that the output of the action will be embedded in a web page (true).
wopisrchttps://<host_address>/ wopi/files/(file_id)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.
favIconUrl"/web-apps/apps/ documenteditor/main/ resources/img/favicon.ico"Indicates that the WOPI server includes a URL to an appropriate favicon for all online office applications. Hosts should use this URL as the favicon for their host page, so that the appropriate application icon appears when the online office is used.

Nextcloud specific

Parameters

NameExampleDescription
langen-usIndicates 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.

Collabora specific

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.

Get Help

  • If you have any questions about ONLYOFFICE Docs, try the FAQ section first.
  • You can request a feature or report a bug by posting an issue on GitHub.
  • You can also ask our developers on ONLYOFFICE forum (registration required).