Scott Schmitz


Gentlemen,

I am interested in using the contacts api to synchronize databases of contacts which we use in our real-estate product RealtyJuggler. This would be great as HotMail Contacts would then act as a bridge between our product and Microsoft Outlook.

However, I have run into a few snags. The trick is identifying which have changed and from which direction. With that in mind, the API seems to lack the following:
1. Modification Date of Individual Contact Records and ability to get a summary with modification dates for all contact records.
2. The ability to query which contacts have been deleted at the hotmail end. That is, how can you idenitify which records have been deleted from Hotmail

Also, it would be real handy to be able to store additional information with each contact record that would be unique to my application - for example I would love to be able to store a record ID to the record in my database. That way, I can easily know if the record that is in HotMail has already been mapped to a record in our application.

thanks,

Scott Schmitz.



Re: Contacts API - Deleted Contacts

YuanYuan Yu - MSFT


Hi, Scott, thank you for your interest in WIndow Live Data. Your question is a very real concern. It is being discussed internally and will be answered soon.





Re: Contacts API - Deleted Contacts

ScottSchmitz

YuanYuan,

that's great.

I just ran into one other tricky issue when trying to Sync and that has to do with Tags also known as Categories and wanted to share some thoughts.

In Windows Live Tags reside outside of the contact itself and the categories themselves have links to the actual contacts themselves. I suspect this is because this mirrors an underlying relational database schema

The trickiness comes when someone edits a category for a single contact - lets say they remove a category for a contact. There's no easy way to detect changes of this nature and easily propigate them. I think you could easily resolve if modified dates were available for each Tag (or perhaps even at a deeper level like the contact ID within eash Tag).

However, I think you should really consider something else. The way Tags are organized, requires extensive parsing of the entire tags list to determine the list of categories for a single contact - sort of cumbersome.

I think assigning categories all at once (like vcard does), would be cleaner from an API standpoint.
Like this inside of the contact inself:

<Tags><Tag>Business</Tag><Tag>Personal</Tag></Tags>

I think this represents more naturally the way people think about contacts - that is, the categories assigned are part of the contact itself.

thanks for listening,

Scott Schmitz
RealOrganized, Inc.





Re: Contacts API - Deleted Contacts

YuanYuan Yu - MSFT

Hi, Scott:

I think that the dominant usage of Tags is to categorizes entities that shares a certain attribute together. Photo tags, blog entry tags, etc, are used for this primary purpose. What you described as "cumbersome" is actually a reverse look up into a categorizing system to find out which categoires that a certain entity belongs to. If we embed the tag inside the entity, it will faciliate the scenario you are concerned with but it will lose its primary functionality, that is, provide a general index index into a collection of entities that share a common attribute.

Can you use XPath to achieve what you want to do Based on your description, I think first retriving the complete Tags collection and then use XPath to look up the ContactID you are interested in may do the trick. Yes, this is not the most direct way as embedding tags inside the entities will provide, but this is a trade-off we have to make to when deciding what is the first and foremost feature we want to support.






Re: Contacts API - Deleted Contacts

ScottSchmitz

YuanYuan,

thanks for insight into why things are the way they are. I'll fetch the entire tag list and parse as you suggest.

Based upon everything, this is what I am thinking of to sync the contacts database with my external one:
Only do below steps if last modficed date for the contacts list has changed - use conditional GET, last-modified-since
1. fetch all the contacts and all the tags
2. do a checksum on XML text for each individual contact and store that in my own database
3. convert tags into a category list (using XPath) for each contact and do a checksum on each of these pieces of text and store
4. Next time I fetch everything I compare the checksums to determine each contact or categoriy that differs and update only those records over to my database.

thanks,

Scott Schmitz




Re: Contacts API - Deleted Contacts

YuanYuan Yu - MSFT

Hi, Scott:

Yes, this looks to be a nice execution plan. We are looking into the feasibility of providing a per-contact level "Last-Modified" feature: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=2099088&SiteID=1 Once that's available, your life of synchronization will be much easier I believe.