Getting only app items by specific date interval in .NET library

Answered

Comments

5 comments

  • Casper Fabricius

    GetItems supports filtering items by a date-field between two dates. Take a look at the API docs, specifically the {key} parameter where it is explained how to construct a date range.

    Using the .NET client, the call would be something like this (not tested):

    var items = clioent.ItemService.GetItems(appid, 500, 0, "1234=2012-11-08-2012-12-24") 

    where "1234" is the id of the date field you want to filter by, and "2012-11-08-2012-12-24" indicates a date between today and Christmas Eve.

    0
    Comment actions Permalink
  • Jesper Lund Nielsen

    Hi Casper

    Thanks for you answer.

    I've now tried, but I get this error:

    Podio.API.Exceptions.PodioResponseException: Invalid value '{key}': Invalid filtering key at Podio.API.Utils.PodioRestHelper.PodioResponse`1.get_Data()

    I've tried following codes:

    1) var items = client.ItemService.GetItems(appid, 100, 0, "19528408=2012-11-08-2012-11-12").Items;

    2) var items = client.ItemService.GetItems(appid, 100, 0, "dato=2012-11-08-2012-11-12").Items;

    Any ideas?

    0
    Comment actions Permalink
  • Casper Fabricius

    My bad, it's actually implemented wrong in the .NET client. It's user contributed code, so not of all it has been tested. I don't know when I will have time to look at it, but the GetItems method needs to be fixed.

    0
    Comment actions Permalink
  • Jesper Lund Nielsen

    Ah, okay. Until then .. then what? Just bomb the Podio API? (don't worry, we only got about 50 items by now, and they are being request every 15. minut)

    0
    Comment actions Permalink
  • Casper Fabricius

    Or you can write your own API call using the "base layer" of the .NET API client as explained in the tutorial - or better yet, submit a pull request ;)

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk