Command service

For the interaction with the document command service the POST requests are used. The request parameters are entered in JSON format in the request body. The requests are sent to the https://documentserver/coauthoring/CommandService.ashx address where the documentserver is the name of the server with the ONLYOFFICE Document Server installed.

In ONLYOFFICE Document Server prior to version 4.2 the GET request with the parameters in the QueryString were used.

See the available command types below to find more about them.

Command types

CommandDescription
dropThis command allows to disconnect the specified users from the document editing service.
forcesaveThis command allows to forcibly save the document being edited without closing it.
infoThis command allows to request a document status and the list of the identifiers of the users who opened the document for editing.
licenseThis command allows to request the license from Document Server with information about the server and user quota.
metaThis command allows to update the meta information of the document for all collaborative editors.
versionThis command allows to request the current version number of Document Server.

The JSON Web Token should be sent in the JSON object format to document command service. It is used to receive the status of the document with the key specified.

  1. {
  2. "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjIjoiaW5mbyIsImtleSI6IktoaXJ6NnpUUGRmZDcifQ.r_6sThjFABsHMNHhkVdHDSz4jwkbXRQNYdvawkBGJgg"
  3. }

Parameters

NameDescriptionTypePresence
tokenDefines the encrypted signature added to the Document Server config in the form of a token.stringrequired by configuration

The document editing service informs the document storage service about the result caused by command and sends the response with all the necessary data via the callback handler.

Possible error codes and their description

Error codeDescription
0No errors.
1Document key is missing or no document with such key could be found.
2Callback url not correct.
3Internal server error.
4No changes were applied to the document before the forcesave command was received.
5Command not correct.
6Invalid token.