podio / podio-dotnet

Podio .NET client
MIT License
19 stars 39 forks source link

Get Tasks Filters #29

Closed cluedindev closed 7 years ago

cluedindev commented 7 years ago

Hi, I am trying to filter Tasks by Responsible using your client and I get the following error.

{"error_propagate":false,"error":"Query not secure enough, must filter on either org, space, app, responsible, reference or created_by","error_description":"Query not secure enough, must filter on either org, space, app, responsible, reference or created_by","request":{"url":"http://api.podio.com/task/","query_string":"limit=25&offset=0&responsible=2532062&sort_by=rank&sort_desc=False","method":"GET"}}

If I try to filter by the Created By then it looks like the wrong json request is being done to the REST endpoint.

Thanks,

cj-phases commented 7 years ago

Hi Tim, I have tried the filtering and found it working, please note we pass profile_Ids as filter parameters for Responsible and not User_ids(I assume this is Podio contact field, if it is an Podio Relationship field the only difference will be you should pass item id of the referred app item)

Documentation Reference - http://podio.github.io/podio-dotnet/items/

Sample Code:

var filter = new Dictionary<string, object> { {<fieldId>, new int[]{ <profileId> } } }; var filteredItems = podioClient.ItemService.FilterItems(< appId >, 400, 0, filters: filter);

cluedindev commented 7 years ago

Hi Cj-Phases,

Spot on! Thanks for that, it worked well.