Paul
Paul

Reputation: 1

Set Facebook Status using FacebookSDK C#

I have looked around and although I have found answers to this explaining how to set Facebook Statuses via the Graph API and REST I have yet to find out if this is possible using a few lines of code via the FacebookSDK as available from facebooksdk.codeplex.com.

I have looked at all code examples on the codeplex site and from what I can tell no example code exists that shows how to do this. I have also downloaded all the example code.

Therefore, could someone please tell me if this is possible and if it is could you please provide a code snippet to show me how? I stress I want to do this from c# using the latest stable build of the facebooksdk if possible (not javascript, REST or any other api).

Thanks,

Paul.

Upvotes: 0

Views: 1186

Answers (1)

Eslam Soliman
Eslam Soliman

Reputation: 1296

you can publish something in your own wall like this :

var client = new FacebookClient("my_access_token");
dynamic parameters = new ExpandoObject();
parameters.message = "Check out this funny article";
parameters.link = "http://www.example.com/article.html";
parameters.picture = "http://www.example.com/article-thumbnail.jpg";
parameters.name = "Article Title";
parameters.caption = "Caption for the link";
parameters.description = "Longer description of the link";
parameters.actions = new {
    name = "View on Zombo",
    link = "http://www.zombo.com",
};
parameters.privacy = new {
    value = "ALL_FRIENDS",
};
parameters.targeting = new {
    countries = "US",
    regions = "6,53",
    locales = "6",
};
dynamic result = client.Post("me/feed", parameters);

and you can post status in you wall like this : "using javascript sdk " http://developers.facebook.com/docs/reference/rest/status.set/

mark as answered if it helps :)

Upvotes: 2

Related Questions