Edit docx file in PHP

Do you want to: Ask a how-to question
Document Server version: latest
Type of installation of the Document Server docker
OS: Ubuntu Server 22.04.4 LTS
Browser version: Chrome Latest

I installed the latest version of DOCS on a local virtual machine. The example works normally, but when using the api on my system, this error occurs:

I’m using the following code as a test:

What am I doing wrong?

Hello,
To resolve the issue, please find the following section in local.json (/etc/onlyoffice/documentserver in the container):

"secret":
  {"inbox":
    {"string": "yoursecret"},
   "outbox": {"string": "yoursecret"},
   "session": {"string": "yoursecret"}

After that, you need to form a token (Security - ONLYOFFICE Api Documentation), sign it with the secret of the config file above (Signature - ONLYOFFICE Api Documentation), the payload should be the entire contents of the editor initialization configuration. Then, you need to pass this formed token as a parameter in the editor initialization configuration (Signature - ONLYOFFICE Api Documentation): Config - ONLYOFFICE Api Documentation
Now it can be seen that no token parameter is provided on the side of your integration

Do you have any sample how to create the JWT (with the correct payload) and send it?

In the guide I mentioned above you can find a sample of a formed token and its payload, if you copy token‘s sample to the jwt.io website, for example, you’ll see its payload.