The reference figure and the steps below explain the process of working with links in ONLYOFFICE Docs.
Specify the event handler for the Get link button to be displayed in the bookmark editing menu in the configuration script for Document Editor initialization. When the onMakeActionLink event is called, the user request is sent to the software integrators which create the link in the document storage service.
var onMakeActionLink = function (event){ var ACTION_DATA = event.data; ... var link = GENERATE_LINK(ACTION_DATA); docEditor.setActionLink(link); }; var docEditor = new DocsAPI.DocEditor("placeholder", { "events": { "onMakeActionLink": onMakeActionLink, ... }, ... });
In order to give the user the link to the document which contains a bookmark, the software integrators send the link to the setActionLink method:
docEditor.setActionLink(link);
When the 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, ... }, ... });