News:

GinGly.com - Used by 85,000 Members - SMS Backed up 7,35,000 - Contacts Stored  28,850 !!

Main Menu

Querying with the Windows Live Presence API

Started by thiruvasagamani, Jan 24, 2009, 07:20 PM

Previous topic - Next topic

thiruvasagamani

Querying with the Windows Live Presence API

The Windows Live Presence API is is an HTTP API for accessing a Windows Live Messenger user's presence. The Windows Live Presence API returns presence in JSON or as a JavaScript function. For a Web site to query a Windows Live Messenger user's presence, the Messenger user must give permission to share presence and receive messages from the Web. The Web site should invite the user to share Messenger presence. See Inviting Users to Share Online Presence for more information.

The Presence API is designed to be easy to use directly from the browser. Access the API using a URL of the following format:


http://messenger.services.live.com/users/[ID]/[resource]/[?queryparameters]


The [ID] is of format id@apps.messenger.live.com, where "id" is a numerical user ID.

The [resource] is either:

    * presence: For presence JSON or JavaScript
    * presenceimage: for an image icon denoting the user's presence

The JSON result for presence is formatted as shown in the following example (assuming 12BACD345678 is the ID of the user whose presence is being queried):
Copy Code

{
   "status": "Offline",
   "icon": {
   "height": 16,
   "url": "http://settings.messenger.live.com/static/w13r2/Conversation/img/Status_Online.gif",
   "width": 16
   },
   "statusText": "Online",
   "id": "12BACD345678@apps.messenger.live.com",
   "displayName": "Name"
}

The Presence API can be used in combination with the IM Control to show the presence of other users who are online, and available for messaging. For example:
Copy Code

<a href="http://settings.messenger.live.com/conversation/imme.aspx?..." target="_blank">
   <img src="http://messenger.services.live.com/users/12BACD345678@apps.messenger.live.com/presenceimage">
</a>
Thiruvasakamani Karnan