Hello,
I am getting an error 400 response when I try to use the API on my sample app.
{“code”:0,“message”:“Transport unknown”}
This is the code of my sample app (which I copied from here Basic concepts - ONLYOFFICE Api Documentation
)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div id="placeholder"></div>
<script type="text/javascript" src="http://0.0.0.0/web-apps/apps/api/documents/api.js"></script>
<script>
config = {
"document": {
"fileType": "docx",
"key": "https://jwt.io/#debugger-io?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.G0X_hg_UT05tEzRrZqW9EEfDMgeBqlxqBHbsmT9liYs",
"title": "Example Document Title.docx",
"url": "http://0.0.0.0/url-to-example-document.docx"
},
"documentType": "word",
"editorConfig": {
"callbackUrl": "http://0.0.0.0/url-to-callback.ashx"
}
};
var docEditor = new DocsAPI.DocEditor("placeholder", config);
</script>
</body>
</html>
Some Logs (Feel free to ask for more)
/var/log/onlyoffice/documentserver/docservice/out.log
[2024-10-25T15:18:52.323] [WARN] [localhost] [docId] [userId] nodeJS - io.connection_error code=0, message=Transport unknown
*/var/log/onlyoffice/documentserver/docservice/out.log *
syscall: ‘open’,
path: ‘/var/www/onlyoffice/documentserver/…/Data/license.lic’
}
[2024-10-25T15:10:05.698] [WARN] [localhost] [docId] [userId] nodeJS - [Error: ENOENT: no such file or directory, open ‘/var/www/onlyoffice/documentserver/…/Data/license.lic’] {
errno: -2,
code: ‘ENOENT’,
syscall: ‘open’,
path: ‘/var/www/onlyoffice/documentserver/…/Data/license.lic’
}
[2024-10-25T15:10:05.835] [WARN] [localhost] [docId] [userId] nodeJS - Express server listening on port 8000 in production-linux mode. Version: 8.2.0. Build: 143