asp.net - (OAuthException) (#200) exception while posting to facebook wall using facebook c#sdk -
i working on asp.net mvc3 , using facebook c# sdk post on fb wall . following error while trying post on wall.
(oauthexception) (#200) user has not granted application permission automatically publish feed stories
please see code used .
string appaccesstoken = "accessstoken"; //this token got after creatting app in fb developer.
facebookclient fb = new facebookclient(appaccesstoken); dictionary<string, object> parameters = new dictionary<string, object>() { {"description", "testbeskrivning"}, {"link", ""}, {"name", "testtitel" } }; fb.post("myfbid/feed", parameters);
that's because haven't added right permission when loginurl: have add following permission: publish_stream.
var oauthclient = new facebookoauthclient(facebookapplication.current); oauthclient.redirecturi = new uri(redirecturl); dictionary<string, object> oparams = new dictionary<string, object>(); oparams.add("scope", "publish_stream"); var loginuri = oauthclient.getloginurl(oparams);
for facebook features need permissions users. check following page current permissions:
https://developers.facebook.com/docs/reference/api/permissions/
Comments
Post a Comment