post Method

Current information about Live Connect is now available in the Windows Live Developer Center. The information in the following sections is provided for legacy purposes only.

Posts a new item to a feed.

Feature:  Microsoft.Live.Services
Namespace:  Microsoft.Live.Services, callback);


Type: Object

The new item to create.

Type: DataSaveCompleted

The event handler that is invoked when the POST is completed.


IDataContextpost(Object, DataSaveCompleted)

The post method allows you to create a new item in a collection without first loading the collection for the data type. The method supports only activities and personal status messages.

The following example demonstrates how to use the post method to add a status activity to an activity collection.

// Ensure the correct scope is set: WL_Activities.Update
function appLoaded(applicationLoadCompletedEventArgs) {
    Microsoft.Live.Core.Loader.load([""], function () {
        var dc = Microsoft.Live.App.get_dataContext();

        // create a status activity
        var activityData = new Microsoft.Live.Services.StatusActivityObject('New status activity...'); Microsoft.Live.Services.AddStatusActivity([activityData], ''), function (dataSaveArgs) {
            var results = dataSaveArgs.get_results();
            if ((results.length != 1) || (results[0].get_resultCode() !== Microsoft.Live.AsyncResultCode.success)) {
                alert('Failed to create new activity: ' + results[0].get_error().message);
            else {
                alert('Success posting new status activity.');

Windows Live Messenger Connect

Supported in: 4.1

Internet Explorer 8.0, Internet Explorer 7.0, Internet Explorer 6.0, Firefox 3.6, Firefox 3.5, Firefox 3.0, Firefox 2.0, Firefox 1.5, Chrome 4.0, Chrome 3.0, Chrome 2.0, Chrome 1.0, Safari 4.0, Safari 3.0