Try the fastest and simplest way to install ONLYOFFICE

CallbackURL in pure HTML and JS usage of onlyOffice

Issues during installation, usage and configuring

CallbackURL in pure HTML and JS usage of onlyOffice

Postby Enelvin » Tue Mar 13, 2018 11:17 am

I want to use onlyOffice inside of a pure HTML and Javascript file. (All of their official examples are based on dynamic web pages like PHP, Node.JS and so on)

SO I installed the integration server of Onlyoffice and made the following html file based on the information placed here:

Code: Select all
<div id="placeholder"></div>
<script type="text/javascript" src="http://localhost/web-apps/apps/api/documents/api.js"></script>
var config = {
    "document": {
        "fileType": "docx",
        "key": "Khirz6zTPdfd7",
        "permissions": {
            "comment": true,
            "download": true,
            "edit": true,
            "print": true,
            "review": true
        "title": "Example Document Title.docx",
        "url": "http://localhost:9500/martin/new.docx"
    "documentType": "text",
    "editorConfig": {
        "callbackUrl": ""
var docEditor = new DocsAPI.DocEditor("placeholder", config);


This code show the editor correctly and load the file. The only problem is callbackUrl which is not well explained in the API.

Now the questions are:

What is the correct callback url? Is this file exist somewhere in the installed integration server?

I guess I have to develope the url-to-callback.ashx file. In case yes then what do I have to write for this file? (Please note I can just use JS and not PHP or other dynamic web languages)
Posts: 2
Joined: Tue Mar 06, 2018 10:12 am

Re: CallbackURL in pure HTML and JS usage of onlyOffice

Postby Maxim » Fri Mar 16, 2018 12:27 pm

Hello Enelvin!
You cannot save the documents using JS and html only. If you delete callbackUrl you will be able just to open a doc. But for saving you need request handler.
Posts: 1433
Joined: Tue Oct 11, 2016 2:34 pm

Return to ownCloud/Nextcloud ONLYOFFICE integration app

Who is online

Users browsing this forum: No registered users and 2 guests