We can list shared folders in Drive with their respective ID:
root@NAS-BACKUP:~# synowebapi --exec api=SYNO.SynologyDrive.TeamFolders method=list version=1 | jq '.data.items[] | "ID: \(.file_id) / Name: \(.name)"'
"ID: 795719640889204739 / Name: photo"
"ID: 781590850416189441 / Name: Share update"
"ID: 766719452698944079 / Name: Test Andrea 2"
Then, we can run a recycle bin deletion of only a specified team folder:
root@NAS-BACKUP:~# synowebapi --exec api=SYNO.SynologyDrive.Trash method=empty path="id:766719452698944079"
{
"data" : {
"async_task_id" : "task-8"
},
"httpd_restart" : false,
"success" : true
}
This can be done with the personal homes too, the home directory to delete will be determined by the user passed in the runner attribute:
root@NAS-BACKUP:~# synowebapi --exec api=SYNO.SynologyDrive.Trash method=empty path=/mydrive runner=joel
{
"data" : {
"async_task_id" : "task-9"
},
"httpd_restart" : false,
"success" : true
}