ONLYOFFICE DocSpace released: improve document collaboration with offices, customers, and partners. Use it for free!
ONLYOFFICE DocSpace released

Deleting a folder and its contents using the API

I have folders with XLSX files in them and want to delete them CLEANLY using the API

/var/www/onlyoffice/Data/Products/Files/00/00/01/folder_1000/file_824/v3/content.xlsx
/var/www/onlyoffice/Data/Products/Files/00/00/01/folder_1000/file_825/v2/content.xlsx

I’ve read through ONLYOFFICE Api Documentation - Delete files and folders

does anyone have a CURL example of how to call the API and delete these two folders and their contents (xlsx and diff.zip) from the current document server Version 12.0.0.1726

The doc server runs on Ubuntu 20.04.6 LTS
Thanks
Ivan

The account I wish to get a token for is ALSO MFA protected so how do I get a token?

curl --request POST --header Content-Type: application/json --data {“username":"user@hostxxx.com”,“password”:“mypass”} https://hostxxx.com:6443/api/2.0/authentication.json
{“count”:1,“status”:0,“statusCode”:201,“response”:{“token”:null,“tfa”:true}

I need a token 1st :slight_smile:

Hello @ivan

The account I wish to get a token for is ALSO MFA protected so how do I get a token?

You have to use this method, please check it out:ONLYOFFICE Api Documentation - Authenticate a user by code

does anyone have a CURL example of how to call the API and delete these two folders and their contents (xlsx and diff.zip) from the current document server Version 12.0.0.1726

You can use Postman app to create request and receive CURL sample via code snippet in the right top corner of the app.

By the way, please note that Community server v.12.0 is outdated. If it’s possible, please update you installation.

Thanks Alexandre, will do, I know postman :wink: … opening new bug around upgrade though…

1 Like