asp.net - How to post on my facebook page from my website using Facebook App keys created from my facebook account? -
below code using achieve functionality, , have posted facebook wall website not able post facebook page?
how can page access token using facebookclient() in c# sdk?
var client = new facebookclient(); dynamic token = client.get("oauth/access_token", new { client_id = configurationmanager.appsettings["facebookapi"].tostring(), client_secret = configurationmanager.appsettings["facebookapikey"].tostring(), grant_type = "client_credentials" }); client.accesstoken = token.access_token; dynamic parameters = new expandoobject(); parameters.title = detail.title; parameters.message = getdescription(detail.description, detail.content); parameters.link = "http://test.com/blog" + detail.relativelink;//httpcontext.current.request.islocal ? "http://test.com/blog" + detail.relativelink : httpcontext.current.request.url.authority + "" + detail.relativelink; var result = client.post(configurationmanager.appsettings["facebookpageid"].tostring() + "/feed", parameters);
please read docs at
it's clear can't use app access token posting page, because post needs related profile.
- a user access token publish_actions permission can used publish new posts on behalf of person. posts appear in voice of user.
- a page access token publish_pages permission can used publish new posts on behalf of page. posts appear in voice of page.
Comments
Post a Comment