Share via


Use the Permission to Obtain Information

Once the OwnerHandle and DomainAuthenticationToken have been obtained, further information requests are sent to the Windows Live service using an HTTPS request URI.

The URI

The exact structure of the URI depends on the schema of the individual service and the information being requested. For the alpha release, however, it will generally be in this form:

https://cumulus.services.live.com/[owner handle]/[service]/[data]

For Windows Live Contacts: a GET request will find or obtain information from the service; a POST request will insert information into the service; a PUT request will update information on the service; and a DELETE request will remove data stored on the service. GET requests require Read permission, and all other requests require Write permission.

For example, a request to Windows Live Contacts to retrieve the entire address book for an OwnerHandle with a value of "someone@example.com" might be an HTTPS GET request with an URI of:

https://cumulus.services.live.com/someone@example.com/LiveContacts

Creating the Request

There are multiple ways to authenticate this request. One of them requires the site to produce the DomainAuthenticationToken saved earlier and add it to the HTTPS request as a header, as shown in the following example:

// Construct the request.
string uri = "https://cumulus.services.live.com/someone@example.com/LiveContacts ";
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
request.UserAgent = "Windows Live Data Interactive SDK";
request.Method = "GET";
// Issue the HTTP GET request to Windows Live Contacts.
HttpWebResponse response = (HttpWebResponse)request.GetResponse();

The exact format of the response depends on the service and the request. For this particular request, Windows Live Contacts will return an XML document in an XML schema, of which the top level is <LiveContacts>.

//The response body is XML: read the stream into an XML Document.
XmlDocument contacts = new XmlDocument();
contacts.LoadXml(new StreamReader(response.GetResponseStream()).ReadToEnd());

See Also

Concepts

Introduction to Windows Live Data Authentication