Access API Documentation | Access Technical Support Portal | Email:
Validic Support Center
Click Here for Latest System Status

Latest endpoint vs. Push Notifications

Last Updated: Aug 29, 2017 08:29AM EDT
Q: What is the difference between using the latest.json endpoint and push notifications?

The primary difference is that push notifications are intended for real time, individual user-level data delivery, while the latest.json endpoint is intended for near real time, bulk population-level data delivery. For large population sets, push notifications don’t always make sense, as your system could end up receiving thousands of push notifications per minute. Additionally, relying on push notifications alone is not recommended for a large scale, high availability setup.

The latest.json endpoint is a much more stable way to access data for a large population set. This call allows you to access all of the latest data in Validic between two timestamps.

Latest.json Best Practices
ATTENTION: This article has been updated to reflect a start_date of the previous end_date for requests to latest.json. Incrementing the end_date by one second for the next start_date will result in a loss of data for any record updated within that second.
A best practices implementation of /routine/latest.json calls would look something like this.
The benefit of this series of calls is that you ping Validic every five minutes (could be every 2 minutes, every 10 minutes, etc.) and you receive any updates that have been made for your organization in the specified time range. So for example, if a user doesn't sync her Fitbit for 5 days and then syncs it on 2014-03-09T10:47:39Z, Validic will return all of her Fitbit activities from the last 5 days in the last call in the series above.
NOTE: When specifying the end_date using this method, it is imperative that server times are synced to Validic's server times. In fact, adding a second or two delay ensures that the end_date requested is not a future date at the time the request is made. You may use the Date header returned by Validic to refer to.
Alternatively, if a latest.json request is made where end_date is not specified, the end_date we return in the summary of a latest call is a perfect candidate for the start_date of your next latest call. This will effectively remove the possibility of missing data using the latest call due to server time differences.

Next latest request start_date
NOTE: Using this method requires the response to be parsed. If requests are made in rapid succession, there is a slight possibility that the start_date will not have been received, parsed and saved before the next latest request is made resulting in the same data, along with new data, being returned again.
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
Invalid characters found