I want to delete files in Sharepoint 2016 from its recycle bin. I am able to delete files from my folder using requests.delete. However, not able to do the same from recycle bin.
Can we achieve that?
I want to delete files in Sharepoint 2016 from its recycle bin. I am able to delete files from my folder using requests.delete. However, not able to do the same from recycle bin.
Can we achieve that?
Try this endpoint:
POST http://<sitecollection>/<site>/_api/web/RecycleBin(recyclebinitemid)/deleteObject()
reference: https://learn.microsoft.com/en-us/previous-versions/office/sharepoint-visio/jj246911(v=office.15)
Interestingly, I have been able to achieve this via shareplum.
cred = HttpNtlmAuth(username,password)
site = Site("sharepointsiteurl",version=Version.v365,auth=cred)
folder = site.Folder('Shared Documents/My Folder')
folder.delete_file('MyFile.csv')
This deletion is apparently deleting file completely. Neither there on Recycle bin nor on Second stage recycle bin.
Did you try Powershell script? There is a Sharepoint function for that