Martin Heller
Contributing Writer

Data Wants to be Free

analysis
May 1, 20073 mins

At Microsoft's MIX07 conference, Yaron Goland gave a talk entitled Opening up Windows Live Data. The description was: Data wants to be free! So come to this technical deep dive to learn how you can POST/GET/PUT/DELETE your way into Windows Live. We cover how you can ask users for permission to access and then interact with their Windows Live services (e.g. address book, Spaces, etc.). Interestingly eno

At Microsoft’s MIX07 conference, Yaron Goland gave a talk entitled Opening up Windows Live Data. The description was:

Data wants to be free! So come to this technical deep dive to learn how you can POST/GET/PUT/DELETE your way into Windows Live. We cover how you can ask users for permission to access and then interact with their Windows Live services (e.g. address book, Spaces, etc.).

Interestingly enough, this talk wasn’t announced in advance, but was posted at the last minute. Microsoft normally only does that when they don’t want to let the cat out of the bag prematurely about a new product or service.

“Data wants to be free!” is of course a takeoff on Stewart Brand’s 1984 pronouncement “Information wants to be free” at the first Hacker’s Conference. But that isn’t really what Yaron was talking about. He was introducing the new Windows Live Data service, which is part of the Windows Live SDK. Microsoft describes this as:

Windows Live Data provides a mechanism by which developers can ask Windows Live users for permission to access the user’s Windows Live services and data on the user’s behalf. Currently Windows Live Data exposes Windows Live Contacts which is the central address book for all Windows Live services. Access to additional Windows Live services will be added for the upcoming Beta and other future releases.

To ask users for permission to access their data, as described in Requesting Permission to Access Users’ Windows Live Data, you basically send the user to a Microsoft page, providing the return address on your site, for example:

https://ux.cumulus.services.live.com/pgux/default.aspx?rl=https://www.sample.com/permit.aspx&pl=https://www.sample.com/privacy.html&ps=LiveContacts.ReadOnly”>

Grant Permission

Then you grab the ResponseCode, DomainAuthenticationToken and OwnerHandle fields from the posted form you get back. If the ResponseCode is “RequestApproved”, you can go ahead and use the DomainAuthenticationToken and OwnerHandle to request data.

The OwnerHandle is basically an email address at this point, and it becomes part of the URI for requesting the data. The DomainAuthenticationToken is supplied as a header to the HTTP request. So, for example, you could ask for an address book for user by sending a GET request to:

https://cumulus.services.live.com/wlddemo@hotmail.com/LiveContacts

with C# code like this:

HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
request.Method = "GET";
request.Headers.Add("Authorization", 
"DomainAuthToken at="" + token + """);
try {
   HttpWebResponse response = (HttpWebResponse)request.GetResponse();
   //request succeeded, process response
   ... 
} catch (WebException ex) {
   //request failed, handle error
   ... 
}

What you’ll get back from this request is an XML document, which you can then parse, or connect to a control.

Obviously, there’s a lot more: Yaron did talk about POST/GET/PUT/DELETE, not just GET, and the documentation explains two other ways of authenticating. The Windows Live Data documentation goes into detail, and I expect that at some point there will be a sample site.

Martin Heller

Martin Heller is a contributing writer at InfoWorld. Formerly a web and Windows programming consultant, he developed databases, software, and websites from his office in Andover, Massachusetts, from 1986 to 2010. From 2010 to August of 2012, Martin was vice president of technology and education at Alpha Software. From March 2013 to January 2014, he was chairman of Tubifi, maker of a cloud-based video editor, having previously served as CEO.

Martin is the author or co-author of nearly a dozen PC software packages and half a dozen Web applications. He is also the author of several books on Windows programming. As a consultant, Martin has worked with companies of all sizes to design, develop, improve, and/or debug Windows, web, and database applications, and has performed strategic business consulting for high-tech corporations ranging from tiny to Fortune 100 and from local to multinational.

Martin’s specialties include programming languages C++, Python, C#, JavaScript, and SQL, and databases PostgreSQL, MySQL, Microsoft SQL Server, Oracle Database, Google Cloud Spanner, CockroachDB, MongoDB, Cassandra, and Couchbase. He writes about software development, data management, analytics, AI, and machine learning, contributing technology analyses, explainers, how-to articles, and hands-on reviews of software development tools, data platforms, AI models, machine learning libraries, and much more.

More from this author