Meet ONLYOFFICE Docs Cloud, complete office software as a service
Meet ONLYOFFICE Docs Cloud

ONLYOFFICE Docs 7.2 for developers: API updates

Originally published at: https://www.onlyoffice.com/blog/2022/10/onlyoffice-api-7-2/

Along with the release of the new features in version 7.2, we updated API for the editors and plugins. Check the details below.

ONLYOFFICE Docs 7.2 for developers: API updates

Live viewer and new license parameters

Live viewer allows users to see the changes made by other collaborators in real time when opening a document, spreadsheet, or presentation in the view only mode. Learn more

To implement this feature, you need to get a new license which will include separate fields for live viewer: connections_view and users_view_count for the number of connections and users, and users_view for user quota. Check the license response info to find out more.

Please note that server connections for live viewer are counted separately from the total number of simultaneous connections*.

*How many browser tabs with documents can be opened for editing at the same time.

Working with documents from the outside

A new API class allows interacting with text documents, spreadsheets, presentations, and fillable forms from the outside. This way, you can create a special connector to make changes to the documents using your own buttons/methods instead of the editor buttons. For example, you will be able to generate a feed with comments from all your documents, reply to them and close comments in one place, or automatically fill out forms with the data exported from databases.

Please note: the Connector API class is included in the Advanced API and at the moment is available as a demo only (it will be added to the API documentation with the next update – version 7.2.1). If you would like to try it now, please contact our sales team at sales@onlyoffice.com.

API enhancements for plugins

Plugin marketplace. The new plugin manager allows users to explore all available plugins and install or remove any plugin with just one click right in the editors. In this regard, we updated instructions in the API documentation on creating and adding plugins. You can also check this blog post.

Updated localization scheme. Now you can add a langs.json file in the folder with translations. Learn more

The new file contains the names of files with translations for a specific language and comprises an array of the following type:

[ 
  "cs-CZ",
  "de-DE",
  "es-ES",
  "fr-FR",
  "ru-RU"
]

New methods: ChangeOleObject, GetAllForms, GetFileToDownload, GetFormsByTag, GetFormValue, GetImageDataFromSelection, GetInstalledPlugins, InstallPlugin, PutImageDataToSelection, RemovePlugin, SetFormValue, ShowButton, UpdatePlugin, etc.

Check the full API changelog for plugins

JWT enabled by default

Starting from version 7.2, a random JWT secret is automatically generated and just needs to be added on the side of the host application. You can obtain the default JWT secret and replace it with a custom key if required. Learn more

Other API updates

Dark Contrast theme. Enable a new Dark theme variation in the editorConfig.customization.uiTheme parameter. It has even darker shades, while the working surface is almost black.

"customization": { ......
   "uiTheme": "theme-contrast-dark",
    }, .......

Adjusting About section. You can now add your company phone number in the About section in the editors, along with your logo, address, email, etc. To do it, configure the editorConfig.customization.customer parameter.

"editorConfig": {         
    "customization": { ........
         "customer": {
         "address": "My City, 123a-45",
           .....
         "phone": "37188888888"
           },

Four-letter language codes. The editorConfig.lang parameter which defines the editor interface language supports four-letter codes. For example, to set Portuguese language, specify pt-pt, while pt-br indicates Brazilian Portuguese.

"editorConfig": {
.....
 "lang": "pt-pt",

The same refers to the language codes zh-cn (Simplified Chinese) and zh-tw (Traditional Chinese).

New action for WOPI discovery. The embedview action in WOPI discovery renders a non-editable view of a document that is optimized for embedding in a web page:

<action name="embedview" ext="docx"...

It works in our SharePoint WOPI integration by replacing the URL according to these instructions and is relevant for all independent WOPI integrators.

Updated pricing calculator

The new package calculator allows configuring more parameters like multitenancy and multi-server, access to advanced API, live viewer, etc. Learn more

Calculate now

Useful links

Get ONLYOFFICE Docs 7.2 Developer Edition

New features in ONLYOFFICE Docs v7.2

Updated API for Document Builder

API documentation

API changelog

ONLYOFFICE for developers