How to use mode: "editor" to create a new document?

Docs state that with editor mode id is needed for the file to open. How would I create a new file ?
When I pass null as an id it opens the default ui, when I pass in an existing id it says I have no access to the room.

How do I create a new file and show the editor directly when calling DocSpace.SDK.initManager ?

Hello @joer00,
Could you describe the step-by-step scenario in more detail?

Not sure what step by step scenario you mean ?
I want to click a button on my page “New Spreadhseet” and it should create a new spreadsheet I can edit.

Hello @joer00
Before opening a file for editing, you need to create the file and pass its ID when opening it for editing.

Here is the link to documentation:
https://api.onlyoffice.com/docspace/javascript-sdk/usage-sdk/samples/create-file-in-selected-folder/

Thanks. I followed the example but createFile does not return the file. It looks like it returns the folder info instead. My code is:

DocSpace.SDK.initManager(config);
                    var frame =  DocSpace.SDK.frames["ds-frame"];
                    const fileName = "Test.docx";
                    const selectedFolder = 1196231;
                    const res = await frame.createFile(selectedFolder, fileName)

and it returns:

Hello @joer00

Please share some information about product that you are using. The category is set to Docs API, but you’ve initially mentioned some DocSpace methods - which product are you using and what exactly you want to achieve with the product?

As you can see from the code and prior messages it is docspace.
To add info, the code I posted indeed DOES create the file, however it does not return the file id, so I can’t open the created file

Any update on this ?

Please check out following documentation on how to create and open files with DocSpace on your site:

Please read the history ! You reply and the link is NOT creating a new file.
I posted my code which is a copy of what Roman posted and as I mentioned and provided a screenshot, the createFile does NOT return the data in the example. It creates the file but does NOT return the file id

If you don’t mind, I will join this thread as well. @joer00 we need some time to check out the described scenario, I will contact you as soon as possible.

Dear @joer00
Please clarify if the file doesn’t open for editing in your scenario. Do I understand correctly that the editor attempts to open a new file but without any result? Do you get any errors in the browser? Also, please confirm that the file is created on the portal in this scenario.

Hi Alex,

can you please scroll up to where I posted my code ? The issue is that calling

const response = await frame.createFile(selectedFolder, fileName)

The response as of your documents should have the id of the created file. However the response returns just an object with a selected Folder property, I attach it again here:

Dear @joer00
Thank you for the provided data! We have found a bug in the described scenario, and we have started working on it. I will update this thread once we have something to share.

Any update on this ? It’s a month old now.
Any work around until the bug is fixed ?

Hello @joer00
We are going to fix the mentioned method in the next DocSpace update (v.3.1.0). The release is planned for 4-6 weeks approximately.

Hello @joer00
The DocSpace v.3.1.0 has been released. This release contain a fix for the mentioned issue in this thread.