Question

I have a SharePoint 2013 autohosted app with a number of lists inside of it. I would like to be able to soft delete a list item using the REST API and have it go to the Recycle Bin instead of being permanently deleted.

According to this page that should be the default:

Use the HTTP DELETE command against the specific endpoint URL to delete the SharePoint object represented by that endpoint. In the case of recyclable objects, such as lists, files, and list items, this results in a Recycle operation.

However whenever I delete an item using the REST API (with HTTP DELETE) it does not go into the Recycle Bin and instead appears to be permanently deleted.

If I go to the ".../{app_name}/Lists/{list_name}/AllItems.aspx" page and delete list items through that interface instead, then they nicely go into the Recycle Bin. Does anyone know how to move list items into the Recycle Bin using only the REST API?

Was it helpful?

Solution

Have you tried using the "recycle" command using the REST API? (not using HTTP DELETE)

Endpoint URI structure:

http://<sitecollection>/<site>/_api/web/lists(listid)/items(itemid)/recycle()

Please refer to the documentation regarding recycle on MSDN: http://msdn.microsoft.com/en-us/library/jj247053.aspx

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top