I am trying to upload a single video on facebook using the latest https://graph-video.facebook.com
graph api. Following is my code:
public void ExternalShare()
{
try
{
var fbp = new FacebookClient("user_access_token");
dynamic parameters = new ExpandoObject();
parameters.source = new FacebookMediaObject { ContentType = "multipart/form-data", FileName = "SampleVideo2" }.SetValue(System.IO.File.ReadAllBytes(@"C:VideoSampleVideo2.mp4"));
parameters.title = "Small New Video";
parameters.description = "Having Fun";
string url = "https://graph-video.facebook.com" + "facebook_User_Id" + "/videos";
dynamic result = fbp.Post(url, parameters);
}
catch (Exception ex)
{
throw;
}
}
After execution. this code giving no exception but every time i execute i am receiving the same id as a response:
Question 2: If there is no exception then this video is not showing on my timeline
2
Answers
According to https://developers.facebook.com/docs/graph-api/reference/video
Just add .mp4 to the FileName
I know its Old Question but I found the error in it.so Hopefully it Helps Others.
this Line Missing ‘/’ after facebook.com so it should be like this
and Problem Solved.