Вот вопросник (transportinoradea):
Ну, наконец, я использовал Facebook Api плюс другой метод вместо CallRequest <>, который дал мне 400 ошибок. Теперь я справился, все в порядке.
/// <summary>
///
/// </summary>
/// <param name="accessToken"></param>
/// <param name="message"></param>
/// <param name="link"></param>
/// <param name="picture"></param>
/// <param name="title"></param>
/// <param name="linkCaption"></param>
/// <param name="description"></param>
/// <returns> Will return empty string if is ok, else will return error message</returns>
public string PublishToFbWall(String accessToken, String message, String link, String picture, String title, String linkCaption, String description)
{
String postData = "";
if (accessToken == "")
return "Access token empty.";
postData += "access_token=" + accessToken;
if (message != "")
postData += "&message=" + message;
if (link != "")
postData += "&link=" + link;
if (picture != "")
postData += "&picture=" + picture;
if (title != "")
postData += "&title=" + title;
if (linkCaption != "")
postData += "&linkCaption=" + linkCaption;
if (description != "")
postData += "&description=" + description;
//postData += "&link=" + "http://www.transportinoradea.ro/";
//postData += "&picture=" + "http://www.transportinoradea.ro/images/logo_transportinoradea_240_100.png";
//postData += "&name=" + "tttt";
//postData += "&caption=" + "linkCaption";
//postData += "&description=" + "description as ds";
return DoFacebookWebrequest(postData, "https://graph.facebook.com/me/feed");
}
/// <summary>
/// Prepare web request...
/// </summary>
/// <param name="postData"></param>
/// <param name="url"></param>
/// <returns> Will return empty string if is ok, else will return error message</returns>
//private string DoFacebookWebrequest(String postData, String url, string accessToken, string message)
private string DoFacebookWebrequest(String postData, String url)
{
try
{
WebClient wcc = null;
try
{
wcc = new WebClient();
wcc.UploadString("https://graph.facebook.com/me/feed", null, postData);
}
catch (System.Net.WebException ex)
{
StreamReader readStream = new StreamReader(ex.Response.GetResponseStream());
//This way wee can see the error message from facebook
string ErrorMessageJson = readStream.ReadToEnd();
JavaScriptSerializer ser = new JavaScriptSerializer();
ErrorFacebook facebookError = ser.Deserialize<ErrorFacebook>(ErrorMessageJson);
//throw new Exception(
return "Error:" + " type(" + facebookError.error.type + "), message:" + facebookError.error.message + " ";
//);
}
}
catch (Exception e)
{
return e.Message;
//throw new Exception(e.ToString());
}
return "";
}