3

As given in https://msdn.microsoft.com/en-us/library/office/dn499819.aspx#bk_WebCollection, recyclebin is a web property which we can get using

http://<site url>/_api/web/RecycleBin.

But i am getting empty results but there are items in my recycle bin. I followed some blogs and found out that this has not been yet implemented in rest calls. But i am not sure if that is the case. Can we get recycle bin items using API given above? If yes then how as i am getting empty results in my case, or can someone verify if it's not implemented yet.

viky.pat
  • 725
  • 9
  • 16

2 Answers2

4

SharePoint has two recycle bins one at site level and other at site collection level. All my deleted data was going to site collection's recycle bin and i was actually looking into site's recycle bin. When i said i had data in recycle bin, it was actually the data in site's collection recycle bin. But in my rest call i was trying to get data from sites recycle bin, which actually has no data so i was getting empty response. When i changed my API to access site collection recycle bin i got the data.

REST
Method: Get
Url: http://<site url>/_api/site/RecycleBin # notice **site** instead of web to access site collection recycle bin.

This returned the expected results.

viky.pat
  • 725
  • 9
  • 16
0

Try this

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

Reference

https://msdn.microsoft.com/en-us/library/jj247053.aspx

Vaibhav
  • 447
  • 2
  • 10
  • Hi Viabhav, I think this api will move the item to recycle bin as written in provided reference. But what i want is to get listing of items which are there in recycle bin. – viky.pat May 10 '17 at 06:19
  • My apologies.. I found this article on stackoverflow which resonates with your need : http://stackoverflow.com/questions/25792930/is-there-a-way-to-retrieve-the-meta-for-a-deleted-item-file-folder-for-office3 – Vaibhav May 10 '17 at 11:03