Windows Live Photo Control - API Reference

API Reference


API Terms of Use

The Windows Live Photo Control is a bit complicated on the inside, but on the outside you only have to create a spacescontrol element and event handlers to receive the selected photo data.

<html xmlns:devlive="http://dev.live.com"> <devlive:spacescontrol style="width:250px;height:500px;float:right;border:solid 1px black;" devlive:privacyStatementURL= "http://mydomain.org/privacyPolicy.html" devlive:channelEndpointURL="channel.htm" devlive:dataDesired="fileExpiringURL,fileAccessControlledURL" devlive:market="en" devlive:timeSuggestion="3600" devlive:onSignin="onSignin" devlive:onSignout="onSignout" devlive:onError="onError" devlive:onData="onData" devlive:onLoad="onLoad"/>

 

You provide

Definition

spacescontrol element

Required
The DOM element (object) that hosts the Windows Live Photo Control. The control displays inside this element.  Note that the HTML attributes of this hostElement may be stripped or altered to control style and placement, use script or CSS rather than inline HTML attributes. The Windows Live Photo Control requires a minimum width of 172 pixels and a minimum height of 232 pixels. The control resizes as its container resizes, and will show more information in larger layouts.

privacyStatementURL

Required
A URL to a document that describes how your Web site will use the information the user is about to send to your Web page. 

channelEndpointURL

Optional
The relative path to the copy of channel.htm on your Web server or domain. If you get this wrong, you won't be able to receive any data from the control. If omitted, the control defaults to looking for "channel.htm" in the same URL directory as the host page.

dataDesired

Required
A string containing a comma delimited list of field names you wish to obtain for each photo that the user selects. 

Valid values are:

fileExpiringURL: This is a URL that does not require authentication but expires after a period of time (default is 1 hour).
fileAccessControlledURL: This is a URL that requires authentication and access privileges to the photo, but never expires.
Caption: This is the caption of the photo.
displayName: This is the display name of the photo.
timeToLive: This is the period that fileExpiringURL is valid.

market

The market or language requested. Supported today:

Chinese (simplified): zh-cn
Dutch: nl
English: en
French: fr
German: de
Italian: it
Japanese: ja (jp is deprecated)
Korean: ko
Portuguese (Brazil): pt-br
Spanish: sp
Swedish: sv

If no market is specified, the English control is displayed.

timeSuggestion

Optional
Sets the suggested expiration time value of fileExpiringURL in seconds. If no value is specified, the default value is 3600 seconds (1 hour). The maximum setting is 2592000 seconds (30 days). Values are rounded to 1 hour, 1 day, 1 week and 1 month.

Known issue: If you receive a fileExpiringURL null value, sign out of the control and sign in again.

innerBackgroundColor

Sets the background color scheme of the internal area.
Color values:

Hex: #ffffff style
Rgb: rgb(255,255,255) style
W3C standard colors: aqua| black| blue| fuchsia| gray| green| lime| maroon| navy| olive| purple| red| silver| teal| white| yellow

If no color is specified, the default colors apply.

innerTextColor

Sets the color scheme of the internal text. See above for supported color values.

outerBackgroundColor

Sets the color scheme of the outer background. See above for supported color values.

outerTextColor

Sets the color scheme of the outer text. See above for supported color values.

linkColor

Sets the color scheme of the URL hyperlinks. See above for supported color values.

onSignin

Optional
This function receives notification when the user logs in. The event handler prototype is function ().

onSignout

Optional
This function receives notification when the user logs out. The event handler prototype is function ().

onError

Optional
This function receives notification when there is an error. The event handler prototype is function ().

onData

Optional
This function receives notification when data is received from the Photo control. The event handler prototype is function (p_items), where p_items contains an array of objects, one per photo. The photo information is provided in the properties of the object, in camel-capped case style, first letter lowercase. For example; p_items[0].fileAccessControlledURL.

onLoad

Optional
This function receives notification when all Photo controls are loaded. The event handler prototype is function().