Hi.
We have lots of REST APIs, but we never had the need to retrieve the state of a resource at a certain point in time.
Imagine we have a "user" resource, with a "legalEntity" and "department" properties.
If I want the current values, I can just do :
GET /api/users?fields=id,name,legalEntity,department
With the log history, I can rebuild the history of a specific property for a specific user :
GET /api/users/123/logs?propertyName=legalEntity&orderby=createdAt,asc
But what if I want a snapshot of the user at a specific point in time. Should I handle something like this :
GET /api/users/123?asOf=2016-01-01T10:00:00.000 ?
I have found several example saying I should use versions, but what I don't like with versions of a resource is that you have to know in advance which version number you should query, and that version number is not directly related to time.
In other words, how to represent a way of querying temporal data ?
Thanks in advance,
Nicolas.
 
| Nicolas Faugout Associé, responsable R&D 
24 rue du Champ de l'Alouette 75013 Paris - France Standard : +33 (0)1 83 64 53 20 |
Retrouvez l'actualité des métiers administratifs et RH sur notre magazine