Edited file not sent to callbackUrl

Integration questions/issues
Post Reply
gregoryapel
Posts: 2
Joined: Fri Aug 07, 2020 4:54 pm

Edited file not sent to callbackUrl

Post by gregoryapel » Fri Aug 07, 2020 6:02 pm

Primary question:
I set up OnlyOffice developer edition document editor and embedded the editor in an iframe inside a Rails application.

When I load the editor, I get the warning modal "The document could not be saved." This is before editing anything.
Screenshot_20200807_122937.png
Screenshot_20200807_122937.png (42.07 KiB) Viewed 394 times
The callbackUrl is routed to a controller action, and my terminal output confirms that it works. Yet, the json does not contain the document:
Parameters: {"key"=>"Khirz6zTPdfd7", "status"=>1, "users"=>["uid-1596817285865"], "actions"=>[{"type"=>1, "userid"=>"uid-1596817285865"}], "id"=>"1", "upload"=>{}}
The "upload"=>{} parameter is empty.

Another question:
There is no explanation on "how" to generate a new document key. It works if I paste in "Khirz6zTPdfd7" in the config object, but it doesn't make any sense.

Another question:
There doesn't seem to be a config key:value for sending a CSRF token. This would seem to be a normal feature for modern APIs.

Another question:
How do I edit the interface, to remove tabs and limit what a user would be able to access? I don't want users to access "File", "Home", "Insert", "References", "Collaboration", "Plugins", and several other UI controls.

Thanks in advance.
Gregory

Carl
Posts: 472
Joined: Thu Apr 12, 2018 10:00 am

Re: Edited file not sent to callbackUrl

Post by Carl » Thu Aug 13, 2020 8:25 am

Hello Gregory,

Please make sure the callbackUrl is accessible for the Document Server:
https://api.onlyoffice.com/editors/trou ... ing#error0
You can also reproduce the 'document could not be saved' issue and check Document Server log files docservice/out.log and converter/out.log for errors.

As for your questions:

1. We don't have such explanation in our documentation because generating a document key is a task of the integrator. You can check out how the keys are generated in our Ruby example:
https://github.com/ONLYOFFICE/document- ... ample/ruby

2. CSRF tokens are not supported.

3. Customization allowed by ONLYOFFICE Developer Edition license is described here:
https://api.onlyoffice.com/editors/conf ... tomization

gregoryapel
Posts: 2
Joined: Fri Aug 07, 2020 4:54 pm

Re: Edited file not sent to callbackUrl

Post by gregoryapel » Mon Aug 17, 2020 5:56 pm

I cannot seem to find the error logs. Inside the docker container:

/var/log/onlyoffice directory is empty.

edit:
Here's my config object:
config = {
"document": {
"fileType": "docx",
"key": "Khirz6zTPdfd7",
"title": "file-sample_500kB.docx",
"url": "/rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBDUT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--b7981fdba6c8a489898e835e852b61c8fdb17670/file-sample_500kB.docx?disposition=attachment",
"user": {
"id": "78e1e841",
"name": "Gregory"
},
"permissions": {
"comment": true,
"download": true,
"edit": true,
"fillForms": true,
"modifyContentControl": true,
"modifyFilter": true,
"print": true,
"review": true
},
"info": {
"owner": "Gregory",
"folder": "/var/www/dropclone/'",
}
},
"documentType": "text",
"editorConfig": {
"callbackUrl": "http://192.168.11.11:3000/uploads/1/onlyOfficeUpdate",
"saveAsUrl": "http://192.168.11.11:3000/uploads/1/onlyOfficeUpdate",
"region": "en-us",
"customization": {
"logo": {
"image": "http://",
"imageEmbedded": "url",
"url": "http://"
},
"goback": {
"url": "http://192.168.11.11:3000/uploads/1/editor",
"text": "Back",
"blank": false,
"requestClose": false
},
"zoom": 100,
"compactToolbar": false,
"leftMenu": true,
"rightMenu": true,
"hideRightMenu": false,
"toolbar": true,
"statusBar": true,
"autosave": true,
"forcesave": false,
"commentAuthorOnly": false,
"showReviewChanges": false,
"help": false,
"compactHeader": false,
"toolbarNoTabs": true,
"toolbarHideFileName": false,
"reviewDisplay": 'original',
"spellcheck": true,
"compatibleFeatures": false,
"unit": 'inch',
"mentionShare": true
}
}
};
var docEditor = new DocsAPI.DocEditor("editor", config);

Carl
Posts: 472
Joined: Thu Apr 12, 2018 10:00 am

Re: Edited file not sent to callbackUrl

Post by Carl » Wed Aug 19, 2020 3:19 pm

Hello Gregory,

1) document.url must be passed as a URL, not a path to file on the server. There is also no such parameter as saveAsUrl in the documentation. Full list of available parameters can be found here:
https://api.onlyoffice.com/editors/advanced

2) For docker installation, logs are located at /app/onlyoffice/DocumentServer/logs/documentserver on host or /var/log/onlyoffice/documentserver/ inside the container.

3) Try to reproduce the issue with open browser console. Check if there are any errors in Network and Console tabs.

Post Reply