Windows Live Data SDK and more

I’m Chris Weeïnk, a Microsoft MVP Windows Live Developer, and this is my first blog post here at LiveSide. I’ve been around in the Windows Vista and MSN/Windows Live communities for a while and I primarily focused on helping developers in those communities.

A couple of days ago, Microsoft launched the alpha version of the new Windows Live Data SDK along with Windows Live Contacts API and Windows Live Spaces Control.

Windows Live Data SDK
The Windows Live Data SDK allows developers to access the user’s Windows Live services and data on the user’s behalf. To protect the user’s privacy, the SDK only provides this data after the user granted permission to the application or web-site. A developer can choose one of the three possible authentication mechanisms to do so:

  • Domain Authentication  Domain Authentication works by placing a hyperlink on your site to the Windows Live Data permission system. Information required in this hyperlink is: the URL of the response processing page, the URL of the privacy statement and the list of permissions requested. When the user clicks on this hyperlink, he will be transferred to the Windows Live Data site, which will ask the user to approve or reject the permission request. If the user accepts the permission request, Windows Live Data will provide the credentials needed to request access to the user’s data. Applications only need to ask the user for permission once. The response by Windows Live Data contains the Domain Authentication token that can be used in further requests. This token should then be added to each request sent to the Windows Live Data site.
  • Mutual SSL Authentication  Mutual SSL Authentication allows web-sites that have valid SSL/TLS certificate for client and server authentication to request access to user’s data without the need to add a token to each request. Applications still need to request access to the user’s data as described at the Domain Authentication bullet, however.
  • RPS (Relying Party Suite) Authentication  RPS Authentication also works by adding tokes to each request sent to the Windows Live Data site. This time however, the tokens can be requested at the Windows Live ID Service. If you’re developing an application, RPS tokens can be requested by using the Windows Live ID SDK. More information about the Windows Live ID SDK can be found here and here.

Once an application is successfully authenticated, it can perform actions on behalf of the user at the user’s data. Because authentication can done both via the Windows Live Data web-site or via the Windows Live ID service, it opens ways for both web-sites and standalone applications to do something useful with the user’s data, while only providing a single access point for developers. As a consequence, developers can easily transform their web-site to a standalone application and vice versa. While currently only the Windows Live Contacts API is supported, we will see more Windows Live services being supported in the upcoming beta version and future releases. More information about the Windows Live Data SDK is available at the MSDN Library.

Windows Live Contacts API
The Windows Live Contacts API allows developers to programmatically access the Windows Live Contacts Address Book database. The released version allows developers to create applications that retrieve, update, add or remove contact data like names, e-mail addresses, telephone numbers, locations and URI’s. Contacts can also be assigned tags like Hotmail or Messenger groups. All of this is achieved by sending HTTP requests with GET, POST, PUT and DELETE methods and the query expression as URI. The HTTP response contains the data requested or, in case of modifications, it will return an HTTP status code indicating success of failure of the action requested.

Information in the Windows Live Contacts Address Book can be queried by XPath-like queries, for example:
/LiveContacts/contacts/contact(1345223)/emails/email(52343)
This query selects the e-mail address with ID 52343 from a contact with ID 1345223.

Update or insert actions contain next to the query expression also the content that has to be updated in the body of the HTTP request.

While the first release of the Windows Live Contacts API only contains functions purely aimed at modifying the Address Book itself, it would be certainly be possible that we will see more features in future releases of this powerful API. More information about the Windows Live Contacts API is available at the MSDN Library.

Windows Live Spaces Control
The Windows Live Spaces Control allows users to select photos from their Space and expose the URL of those photos to the web-site containing the Spaces Control. It’s in that way very similar to the Windows Live Contacts Control, which allows you to expose certain contact data. The actions required to use the Spaces Control are also quite similar to the Contacts Control: you need to add a pseudo HTML element tag “spacescontrol” to place the Spaces Control on your HTML page, fill in its attributes to specify its options and operations and finally include references to two JavaScript files. You can find more information about the options in this blog post by Danny Thorpe. More information about the Windows Live Spaces Control is available at the Windows Live Dev site.