[Beginner] How to get document key/url to open it in web editor?


Sorry for the probably noobish question, but I’ve really searched for hours now and can’t seem to find any help for a somewhat easy problem (at least I thought it was easy).

I installed the document server part using Docker-Compose and launched the provided example in the docker image and when opening it in the browser, it works perfectly. I can create and edit documents. Fine.

Then I try to embbed the editor in my frontend application (made with Angular but it should not matter). My problem starts with the editor’s configuration. I don’t seem to be able to start from a fresh document because it seems that the document.url and document.key are mandatory to launch the editor. And I can’t seem to find those infomration when I launch the editor in the previously created documents (with the provided example).

So how do I get the key and url corresponding to a already created document and how do I start an editor directly a new document?

Seemed a fairly simple use case but I can’t seem to find any documentation on this. Can somebody at least give me a hint? Help would be appreciated.



You as the integrator cannot get document key/url from anywhere because your application has to generate these and pass to the Document Server via editor initialization config.

Please see this:

Thanks for you answer, but I’m still completly clueless. I’ve seen your page many times and my concern is with last step, the document configuration where you have to put the key and URL of the document you want to open. I have a document that opens locally at this URL: http://localhost/example/editor?fileName=new.docx. This URL works fine and I can edit my my file.
Now, I want to do the same thing integrated on my website, how do I get the corresponding key and URL of this file to open it embedded on my website. I’m basically doing the same example as the one you pointed out in documentation.

Thanks for your help.


The file must be stored in your application and you have to form a URL to this file. The integration examples provided here ONLYOFFICE Api Documentation - Language-specific examples are the basic-level applications that are there just to demonstrate the principles of the interaction between the document storage and the Document Server. You should not use these examples as the basis for your own application.

Oh ok! I think I start to understand a bit more and why I was so far from understanding… I just thought that the Document Server (and document storage) was the only thing that I needed to add on backend side… but it seems that I need to do myself some kind of middleware to make it work. Am I right?
I thought that I could launch the onlyoffice docker-compose and I would have already a backend where I could post files and render them using frontend editor… I mean this should be done this way but I guess I have a bit more work than intended…
Well thanks for pointing me out to right direction.