Use of if-modified-since approach

43 views
Skip to first unread message

wasabhi

unread,
Jul 27, 2011, 3:36:52 PM7/27/11
to Donor Tools API
Hi there,

I need a mechanism to easily be able to identify objects that have
been created or updated since a specific point in time.

The use case is straight forward - to run a frequent query (hourly/
daily) that needs to be able to quickly pick up new or modified
objects since the last time this query was made. EG show me all
contacts that have changed since the last time I looked.

Is this on the roadmap/can it be implemented with ease? I've read the
API docs and this is not described - unless I have totally missed
this.

I've seen this on many other APIs, and it can be implemented in two
ways:

- query param
- header request

Both of the above would be supplied a UTC timestamp.

Any thoughts?
Abhinav

Ryan Heneise (Donor Tools)

unread,
Aug 1, 2011, 5:56:48 PM8/1/11
to Donor Tools API
Hi Abhinav,

Thanks for this feedback. This is a great request.

We've added the ability to retrieve records that have been created or
updated since a specific point in time. To use, simply pass a
datestamp (YYYY-MM-DD) in the "since" parameter, like this:

`/people.xml?since=2011-07-15`.

You can also do this with donations, though the request format is
slightly different. You can pass a range using the `range[from]` and
`range[to]` parameters, like this:

`/donations.xml?range[from]=2011-07-01&range[to]=2011-08-31`

This update is pending deployment, and we'll push it out later this
afternoon or tonight. You should be able to use it by tomorrow.

Thanks again for this great request!

Ryan

Ryan Heneise (Donor Tools)

unread,
Aug 1, 2011, 6:04:23 PM8/1/11
to Donor Tools API
Just a quick addendum...

You can also specify the "since" parameter as a timestamp, in the
following format:

`/people.xml?since=2011-08-01T22:00`

That is, "YYYY-MM-DDTHH:MM"

The actual time is localized and depends on the timezone set for your
user account (the user account accessing the API), which is set under
Settings > My User Account.


On Jul 27, 2:36 pm, wasabhi <abhinav.kesw...@gmail.com> wrote:

wasabhi

unread,
Aug 1, 2011, 6:50:43 PM8/1/11
to Donor Tools API
Thanks Ryan - this is great - I will test this out once you've
deployed.

In terms of your addendum I'd think that a UTC timestamp might be a
more general solution than a localised approach ... unless you're
storing timestamps in localised form as opposed to UTC.

Anyway - I will test this out tomorrow and provide any further
feedback - thank you very much for handling this so quickly.
Abhinav

On Aug 2, 10:04 am, "Ryan Heneise (Donor Tools)"
Reply all
Reply to author
Forward
0 new messages