cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Workflow Hero

Delete Item with REST

Jump to solution

UPDATE:

I was able to get the call working on other libraries so I think I was testing it on a cooupt library.

 

I would still like to delete Items in folders and have changed my request URL to Web/_api/web/lists/getfolderbyserverrelativeurl('TxtFirstList/StrFolder')/TxtFileName

 

I'm getting this error: "Cannot find resource for the request getfolderbyserverurl" 

 

We have a lot of items within folders that I would like to address with this clean-up project.

Any Ideas?

 

Thanks

Kassie

 

 

Hey there everyone,

I know REST actions have beed discussed a lot but I'm specifically trying to delete items in various libraries with a web request and at the moment I'm baffled. Here's the previous post I was using to build it: SP2013 REST API

 

This call was working and now it isn't. Could anyone help me out. I'm supposed to be rolling this out today.

REST1.png

 

Here's an email I'm sending myself with the values that are being applied. It looks like the list name and Item number are correct, bit it isn't deleting the item. The workflow also runs all the way through with no errors. I'm at a loss.

Rest2.png

If I can get this working again, I would like to add the ability to delete documents within folders as well with my call. So maybe add a "GetByFolder"

This is my first time attempting this so any help you can give would be appreciated.

 

Thanks

Kassie

 

 

Labels: (1)
0 Kudos
Reply
2 Replies
Workflow Hero

Re: Delete Item with REST

Jump to solution

I would still like to delete Items in folders


 

correct call should have been

http://site url/_api/web/GetFileByServerRelativeUrl('/Folder Name/file name')

 

https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/working-with-folders-and-files-with-rest 

0 Kudos
Reply
Workflow Hero

Re: Delete Item with REST

Jump to solution

Yes, this is totally it.

This is what I ended up with for my URL: Web URL/_api/web/getfilebyserverrelativeurl('/ccd/TxtFirstList/StrFolder/TxtFileName')/recycle()

 

(CCD is the site collection name) not sure why I had to add it again but that's what worked.

 

I added the recycle to the end instead because adding the delete method in the header did a hard delete and I want the items to be in the recycle bin for a bit in case the user deletes in error.

 

Thanks!!

Kassie

 

Thanks guys!

0 Kudos
Reply