.NET Podio filter INT erro
AnsweredHi,
I have a problem in API .NET PODIO . I'm trying to filter an INT field. But this error is occurring “PodioAPI.Exceptions.PodioBadRequestException”.
Code:
var _podio = new PodioAPI.Podio("MyArea", chaveAreaTrabalho);
_podio.AuthenticateWithApp(idAPP, keyApp);
var clients = new List<Client>();
var filterOptions = new FilterOptions();
var filter = new Dictionary<string, object>();
// Param filter
filter.Add("cod-client", codClient);
filterOptions.Filters = filter;
var filteredContent = _podio.ItemService.FilterItems(idAPP,filterOptions); //ERROR Occurs in this line
Erro Description
Invalid value 147990 (integer): must be object
Note: I am following the PODIO documentation. http://podio.github.io/podio-dotnet/items/
-
Hi Thiago,
If you are trying filter with a numeric field please try the below example:
// filter items with numeric field value from 100 to 200 string numberFieldId = "1232131"; var filter = new Dictionary<string, object> { {numberFieldId, new { from = 100, to = 200} } }; var filteredItems = podio.ItemService.FilterItems(appId: 123, filters: filter);
This example is already mentioned in PODIO .NET client documentation.
-
Podio API only allows to filter the numeric with range. See the documentation here: https://developers.podio.com/doc/filters
-
Hi If you want to filter items use this code in .net
var filterOptions = new FilterOptions();
var filter = new Dictionary<string, object>();
// Param filter
filter.Add("loan-request-id", "12-2016111502"); // key, value and can add more filters
filterOptions.Filters = filter;
var filteredItems = podio.ItemService.FilterItems(appId: app_Id, filterOptions: filterOptions, includeFiles:false);Hope It Helps
Please sign in to leave a comment.
Comments
6 comments