Post

0 followers Follow
0
Avatar

.NET - Delete item(s)

HI -

It appears that the evolving .NET library doesn't support deleting items yet.  So I'm trying to use the RestHelper method but am obviously confused:

string PODIOAPI_BASEURL = "https://developer.podio.com/";

string requestUrl = Podio.API.Constants.PODIOAPI_BASEURL + "/DELETE/item/(" + itemId + ")/";

// request the api

Podio.API.Utils.PodioRestHelper.PodioResponse response = Podio.API.Utils.PodioRestHelper.Request(requestUrl, client.AuthInfo.AccessToken);

LogFileWriteLine(response.Data);

yields:

11/30/2012 1:51:22 PM   {"error_propagate":false,"error_parameters":{},"error_detail":null,"error_description":"No matching operation could be found. The path '\/DELETE\/item\/(23673529)\/' was not found..","error":"not_found"}

So how should I format the requestUrl string?

Rich Stoldt Answered

Please sign in to leave a comment.

10 comments

0
Avatar

Anyone?  The API doc refers to an item.Delete method but I definitely don't see that available.  I'm looking to deploy a solution and the ability to delete an item is my only obstacle at this point.  Any help is appreciated.

Rich Stoldt 0 votes
0
Avatar

Hi Andreas -

Removing the trailing slash doesn't appear to help - the error is basically the same.

{"error_propagate":false,"error_parameters":{},"error_detail":null,"error_description":"No matching operation could be found. The path '\/DELETE\/item\/(23673529)' was not found..","error":"not_found"}

URL = https://api.podio.com/DELETE/item/(24959120)

Rich Stoldt 0 votes
0
Avatar

You also have brackets around the item_id, remove those :)

Andreas Haugstrup Pedersen 0 votes
0
Avatar

Still no dice.

12/4/2012 1:30:24 PM    {"error_propagate":false,"error_parameters":{},"error_detail":null,"error_description":"No matching operation could be found. The path '\/DELETE\/item\/23673529' was not found..","error":"not_found"}

URL = https://api.podio.com/DELETE/item/24959120

Rich Stoldt 0 votes
0
Avatar

OK - which brings us back to the real question.  How to delete an item using the .NET client library?  It would appear that the RestHelper mechanism is the only way to do it.  Perhaps Casper might comment since he seems to be fielding the .NET questions?

Rich Stoldt 0 votes
0
Avatar

The .NET API client does support deleting items:

https://github.com/kasperbumbech/Podio.API-for-.NET/blob/master/Podio.API/Services/ItemService.cs#L189

There is no delete method available on an item model instance, you have to use the item service providing the id of the item to delete similarly to how it's done here:

https://github.com/kasperbumbech/Podio.API-for-.NET/blob/master/Podio.API.Examples.MVC3/Controllers/ItemController.cs#L64

Deleting an item is also documented in the comprehensive tutorial for the .NET client:

https://developers.podio.com/clients/dotnet

I'd recommend that you familiarize yourself with both the tutorial and the sample MVC project, as they showcase most what the .NET client currently supports.

Casper Fabricius 0 votes
0
Avatar

Thanks, Casper.

Trust me, I've reviewed all that you've pointed out.  I have finally realized my problem was using an outdated version of the API - one where ItemService had no Delete method.  You can see where the disconnect happened.

Thanks again to all.

Rich Stoldt 0 votes