Getting Started with Windows Live Contacts API

本文介绍了 Windows Live Contacts API 的工作原理及如何使用 REST 协议进行数据操作。该 API 支持 GET、POST、PUT 和 DELETE 方法,允许开发者通过 HTTP 请求访问 Windows Live 联系人地址簿。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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

GET

Retrieves 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.

POST

Inserts 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.

PUT

Updates 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.

DELETE

Removes 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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值