A lingering question of mine from the Intro to the REST API session at the conference: So, a 409 should be generated if you attempt a PUT on an object that has been update since your last GET. Where does that timestamp come from? Is it managed internally, some kind of tracker with the session, or is it based on a timestamp supplied with the call?
There is a LastUpdated parameter within the call so you need to run a GET just before a PUT if the call requires the lastUpdated timestamp to get the most recent info. As the timestamp may have been updated outside of the API or the current session I don't think there is any other way of getting this information.
Interesting: so if I fudged the timestamp in my request I could possibly circumvent the check? Not that I can imagine wanting to.
This is the API"s implementation of Optimistic Locking, and tries to prevent friendly fire (one request overriding another's updates). The UpdateDateTime on entities comes from the "last_updated_dt" column in the corresponding DB table. It must match on a PUT with the current UpdatedDateTime on the entity or you will see a 409 response. In practice, if you are attempting to make an update, always GET as close as possible to the update to ensure your working copy is not stale.