CallbackURL in pure HTML and JS usage of onlyOffice

Document Server releases and description of the update.
Post Reply
Enelvin
Posts: 3
Joined: Tue Mar 06, 2018 10:12 am

CallbackURL in pure HTML and JS usage of onlyOffice

Post by 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

<html>
<head>
</head>
<body>
<div id="placeholder"></div>
<script type="text/javascript" src="http://localhost/web-apps/apps/api/documents/api.js"></script>
<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": "http://example.com/url-to-callback.ashx"
    }
};
var docEditor = new DocsAPI.DocEditor("placeholder", config);

</script>
</body>
</html>
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)

Maxim
Posts: 1751
Joined: Tue Oct 11, 2016 2:34 pm

Re: CallbackURL in pure HTML and JS usage of onlyOffice

Post by 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.

Enelvin
Posts: 3
Joined: Tue Mar 06, 2018 10:12 am

Re: CallbackURL in pure HTML and JS usage of onlyOffice

Post by Enelvin » Mon Mar 26, 2018 3:37 pm

Hello, Maxim!

Can you help me create this request handler?

I plan to experiment in Python!

I'm having a hard time with this.

But before we even continue I want to tell you that the file in Onlyoffice does not even open.

As you can see in the image, the editor opens but does not allow any editing.

Image

Maxim
Posts: 1751
Joined: Tue Oct 11, 2016 2:34 pm

Re: CallbackURL in pure HTML and JS usage of onlyOffice

Post by Maxim » Tue Apr 03, 2018 10:23 am

Hello Enelvin!
Can you help me create this request handler?
Unfortunately no. Why do you need Document Server? What for?

Post Reply