ONLYOFFICE for developers: updated API for Docs 6.1

14 December 2020By Ksenija

Hello everyone!

Along with the ONLYOFFICE Docs version 6.1 release, we also updated ONLYOFFICE API documentation and added several useful articles for developers. Find details in this post.

ONLYOFFICE for developers: updated API for Docs 6.1

Changelog for ONLYOFFICE Docs 6.1

We updated API for the latest version of ONLYOFFICE Docs:

  • The text, spreadsheet and presentation values for the documentType parameter were deprecated. Now word, cell and slide values are used instead.
  • Conversion of fb2 format was added.

Using key parameters in co-editing

In order to open a document for editing, the config initialization requires the key parameter which allows users to reopen the document from the editor cache.

This article explains how to make users have the same key to open a document for co-editing.

E.g. here is the script where the key is unknown and the URL for opening the file is specified:

new DocsAPI.DocEditor("placeholder", {
    "document": {
        "fileType": "docx",
        "key": "Khirz6zTPdfd7",
        "title": "Example Document.docx",
        "url": "https://example.com/url-to-example-document.docx"
    },
    "documentType": "word",
    ...
});

Opening a document via an action link

In this new article, you will learn about the process of working with links in ONLYOFFICE Document Server, incl. opening a bookmark.

When a user follows the link, the document editor sends the initialization editorConfig to the document editing service. The ACTION_DATA received from the onMakeActionLink event is specified in the data.actionLink parameter of the editorConfig:

var docEditor = new DocsAPI.DocEditor("placeholder", {
    "editorConfig": {
        "actionLink": ACTION_DATA,
        ...
    },
    ...
});

Working with user mentions in comments in text docs

A newly added article describes the process of mentioning users in comments in ONLYOFFICE Document Server.

The whole process comprises the following steps:

  1. A user sends a request to get a list of users who can be mentioned by typing the + sign in the comment field in the document editor.
  2. The document editor informs the document manager about the request.
  3. The document manager sends the list of users to the document editor where this list will be displayed under the comment field.
  4. A user types a comment in the comment field and the comment is added to the document.
  5. The document editor sends the message, the list of emails and the link action to the document manager.

Working with the Review option in documents

The Review option allows users to review a document, change sentences, phrases and other page elements, correct spelling, etc. without actually editing it. All the changes will be recorded and shown to the author of the document.

In order to enable the Review option, the review parameter in the permissions section of the document initialization must be set to true. In this case, the document status bar will contain the Review menu option.

Open the full article

Inline editors

Following this article, you can connect several editors to the same HTML page in ONLYOFFICE Document Server.

ONLYOFFICE for developers: updated API for Docs 6.1

Using plugin styles

To adjust the connected plugin to the ONLYOFFICE editor style, you can use the associated styles. They are connected to the plugin in the index.html file.

The plugin.css code contains ONLYOFFICE styles for different interface elements. Stylesheet can be connected to the index.html file the following way:

<link rel="stylesheet" href="https://onlyoffice.github.io/sdkjs-plugins/v1/plugins.css">

Open the full article

About ONLYOFFICE Docs Developer Edition

ONLYOFFICE Docs Developer Edition comprises powerful online editors for text documents, spreadsheets, and presentations highly compatible with MS Office file formats. You get high-quality formatting and a vast range of collaborative features. The HTML5 Canvas technology ensures 100% view, conversion, print, and pagination fidelity.

ONLYOFFICE Docs can be smoothly integrated into any web solution no matter what deployment model you use: SaaS or On-Premises, and no matter in what programming language your application is written: .Net (C#), Node.js, Java, PHP, Ruby, etc.

White Label option allows using ONLYOFFICE Docs under your corporate brand, namely, customize the editor interface, change the presence or absence of the additional buttons, links, change logos and editor owner details.

The editors’ functionality can be easily extended with multiple plugins: you can use the already integrated ones, or create and add your own add-ons.

Create your free ONLYOFFICE account

View, edit and collaborate on docs, sheets, slides, forms, and PDF files online.