How can i get the document.key?

Hello.

Each file has its own unique ID. For example, ID=1234 in the editor. This ID can be seen in the document link (https://test.com/Products/Files/DocEditor.aspx?fileid=1234).

API methods require a different document.key:
https://api.onlyoffice.com/editors/config/document#key

Using a url as a document.key does not work. Tell me please, how can I find out the document.key of a specific document?

Hello @arxonix7

Please share the desired scenario that you are trying to achieve.

Hello @Constantine

To get a fresh revision of documents, it is necessary that all editors leave it. I want to use the drop method to exclude users:
https://api.onlyoffice.com/editors/command/drop

I also want to get information about editors in document:
https://api.onlyoffice.com/editors/command/info

Unfortunately, in the Workspace it is impossible to get the document key.

However, if you want to have revisions of the files while they are edited as a workaround solution you can enable ‘Keep intermediate versions while editing’ feature in the settings of Document Module. It will activate a ‘Save’ button on the main toolbar and by clicking it or using CTRL+S combination the saving of the document will be triggered so you won’t need to end the editing session.

Ok, thanks for answer!

1 Like

I’m trying to find the same answer. In the documentation at (ONLYOFFICE Api Documentation - Config) the page details a “key” to identify the document. Where do I get this key from?

1 Like

Hello @michaelT

If you are trying to integrate Document Server with your own application, then document key generation is your task as independent integrator and must be performed on document storage application side.

If you are struggling with this, you can download and install a language-specific example which is a simple DMS (Document Management System) to check out how it is performed there:
https://api.onlyoffice.com/editors/demopreview

The integration examples are used to demonstrate document editors functions and the ways to connect Document Server to your own application. DO NOT USE these examples on your own server without PROPER CODE MODIFICATIONS! If you enabled any of the test examples, disable it before going for production.