Issues Integrating DOCS API with My Website for Document Editing

Hi ONLYOFFICE Community,

I’m working on integrating the ONLYOFFICE DOCS API into my CapCut website to allow users to edit documents directly within their browser. While most features are working, I’m encountering a few issues:

  1. When embedding the editor in an iframe, the document occasionally fails to load, showing a “connection lost” error.
  2. Changes made by users are not always saved back to the server, even though I’ve implemented the save callback as per the API documentation.
  3. I’m seeing CORS-related errors in the browser console, despite setting up the appropriate headers on my server.

Here’s what I’ve tried so far:

  • Verified that the ONLYOFFICE server is up and running without any network interruptions.
  • Cross-checked my implementation with the DOCS API documentation to ensure the configuration is correct.
  • Enabled debug logging on my server but didn’t find anything unusual.

Is there a specific configuration or additional headers required for stable integration? Could this be an issue with my server setup, or am I missing something in the DOCS API implementation?

I’d appreciate any guidance or examples of successful integrations!

Thanks in advance for your help!

Hello @joeroot
Please provide the following additional info:

  1. The version of the installed Document Server
  2. Type of the Document Server installation (deb/rpm, Docker, Windows Server)
  3. Document Server logs (/var/log/onlyoffice/documentserver, for Docker - inside the container; Windows Server - C:\Program Files (x86)\Ascensio System SIA\DocumentServer\Logs)
  4. Screenshots of DevTools → Console and Network tabs content when reproducing the issue

Thank you for your reply! Here’s the requested information:

Version of the installed Document Server:
The installed version is 7.4.0.

Type of Document Server installation:
The Document Server is installed using Docker.

Document Server logs:
I’ve extracted the logs from inside the container. Below is a snippet of the relevant logs:

[LOG EXCERPT HERE: Share any relevant log entries, or mention that you can share logs in detail if needed.]

Additionally, I noticed the following patterns while troubleshooting:

  • The “connection lost” error seems to occur intermittently, especially after the iframe stays idle for a while.
  • The CORS-related errors in the Console indicate potential misconfigurations, but I’ve already set the following headers on my server:

Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Allow-Headers: Authorization, Content-Type

  • Are there any additional headers that need to be included?

Let me know if you need more detailed logs or further information. Thanks again for your support!

Hello,
We still need the Document Server logs (whole logs folder) as well as the screenshot of Network and Console tabs while reproducing the issue