Shuvojit Halder

Shuvojit Halder

  • NA
  • 763
  • 44.1k

Facebook wall post.

Aug 21 2015 6:46 AM
I'm using this URL for posting my wall from my .cs page
 
 
"https://graph.facebook.com/"+Session["uid"].ToString()+"/feed?message="+Message+"&access_token="+Session["accessToken"].ToString()+""
 
 
and my code is
 
var postValues = new Dictionary<string, string>();
LoginSocialMedia _LoginSocialMedia = new LoginSocialMedia();
_LoginSocialMedia = Session["ModelData"] as LoginSocialMedia;
Session["uid"] = _LoginSocialMedia.UserId;
// list of available parameters available @ http://developers.facebook.com/docs/reference/api/post
postValues.Add("access_token", Session["accessToken"].ToString());
postValues.Add("message", Message);
string facebookWallMsgId = string.Empty;
string response;
//MethodResult header = SubmitPost(string.Format("https://graph.facebook.com/{0}/feed", Session["uid"].ToString()),
// BuildPostString(postValues),
// out response);
MethodResult header = SubmitPost("https://graph.facebook.com/"+Session["uid"].ToString()+"/feed?message="+Message+"&access_token="+Session["accessToken"].ToString()+"",
BuildPostString(postValues), out response);
if (header.returnCode == MethodResult.ReturnCode.Success)
{
var deserialised =
Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<string, string>>(response);
facebookWallMsgId = deserialised["id"];
TempData["ResultMes"] = "Successfully posted";
}
 
 
 
 
 
 
This code is not working and showing 403 access forbidden  .

Answers (4)