您的位置:首页 > 其它

Getting Started with Windows Live Contacts API

2010-02-02 03:42 393 查看
http://msdn.microsoft.com/en-us/library/bb463982.aspx

The Windows Live Contacts API defines a set of Web services that enables customers to programmatically access the Windows Live Contacts Address Book database. The Windows Live Contacts Web service is exposed to clients in a HTTP/GET request interface with XML response. This API is intended for customers and partners who want to take advantage of the Address Book service known as Windows Live Contacts. An example of an application that may be built on this API is described in About the Windows Live Contacts API. Using REST with the Windows Live Contacts API To use the Windows Live Contacts API, an application must use the Representational State Transfer (REST) protocol to send requests to Windows Live Contacts and receive responses in reply. REST is an HTTP-based protocol for remote data operations, for example from a client application to a Web service. With REST, the object and the verb are separated because a fixed set of verbs exist. You supply the path of the object within the schema on which you want the action to take place. The HTTP methods that the Windows Live Contacts REST implementation supports are based on the definitions in RFC 2616.

MethodUsage
GETRetrieves whatever information is identified by the request Universal Resource Identifier (URI). When a GET request succeeds, the response contains the data that is requested. For more information, see Windows Live Contacts API Methods: GET.
POSTInserts the data that is enclosed in the request body as a child of the element or elements identified by the request URI. When a POST request succeeds, the response code is the "201 Created" status code, and the response contains a Location header that points to the newly-created object or objects. For more information, seeWindows Live Contacts API Methods: POST. When a caller uses the POST method, the caller inserts data under the parent that the request URI identifies. Multiple child objects can be created by using a single POST request.
PUTUpdates the object that is identified by the request URI with the data that is supplied in the request body. When a PUT request succeeds, the response code is the "204 No Content" status code, and no content is returned. For more information, see Windows Live Contacts API Methods: PUT.
DELETERemoves the data object that is identified by the request URI. When a DELETE request succeeds, the response code is the "204 No Content" status code, and no content is returned. For more information, see Windows Live Contacts API Methods: DELETE.
The request URI identifies the object or the class to be manipulated by the method. Additionally, the request URI effectively describes the path through the data hierarchy to the object or objects. An example request URI might be:
/LiveContacts/Contacts/Contact(ContactID)/Locations/Location(LocationID)/CompanyName

This request URI identifies a specific Contact container by ID (ContactID) and, within that contact, a specific location class by ID (LocationID), which could refer to any Location container. Then, the request URI identifies the actual property. In this example the actual property is the CompanyName element.
With this URI format and a chosen method, you can identify and act on any piece of data in Windows Live Contacts by using a single HTTP call.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: