Search code examples
google-contacts-api

What is the difference between ContactEntry.getUpdated() and ContactEntry.getEdited()


The Java API documentation for ContactEntry states the following:

  • getUpdated(): Get a DateTime instance representing the last time this resource was updated. Represents the atom:updated element.
  • getEdited(): Get a DateTime instance representing the last time this entry was edited. Represents the app:edited element.

In all the examples I've seen, these two seem to have the same time stamp. Is there any difference between them?


Solution

  • Since we are talking about the Contacts API, they are the same. The wire format of the API uses an Atom feed.

    Their technical definitions are subtly different and both are included for compatibility with both the standard Atom Syndication format and the Atom Publishing Protocol.

    <app:edited> is updated every time a feed item is edited: https://www.rfc-editor.org/rfc/rfc5023#section-10.2

    <atom:updated> is updated every time a feed item is edited in a significant way: https://www.rfc-editor.org/rfc/rfc4287#section-4.2.15

    For contacts, they were either edited or they weren't, so they mean the same thing in the context of the Contacts API.