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
Command Description
drop This command allows to disconnect the specified users from the document editing service.
forcesave This command allows to forcibly save the document being edited without closing it.
info This command allows to request a document status and the list of the identifiers of the users who opened the document for editing.
license This command allows to request the license from Document Server with information about the server and user quota.
meta This command allows to update the meta information of the document for all collaborative editors.
version This 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.

    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjIjoiaW5mbyIsImtleSI6IktoaXJ6NnpUUGRmZDcifQ.r_6sThjFABsHMNHhkVdHDSz4jwkbXRQNYdvawkBGJgg"
Name Description Type Presence
token Defines the encrypted signature added to the Document Server config in the form of a token. string required by configuration

The document editing service informs the document storage service about the result caused by command using the callback handler.

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