问题
I have a facebook page with an user as administrator. This facebook user is authenticated successfull via c# facebook sdk. Posting to the photos tab of the page works for me:
FacebookClient fb = new FacebookClient(_accessToken);
fb.AppId = APPID;
fb.AppSecret = SECRETID;
dynamic parameters = new ExpandoObject();
parameters.message = "test1";
var bytes = File.ReadAllBytes(@"C:\temp\excel.jpg");
parameters.source = new FacebookMediaObject
{
ContentType = "image/jpeg",
FileName = Path.GetFileName("ffdsfsa")
}.SetValue(bytes);
var res = fb.Post("/[photosID]/photos", parameters); // changing to albumID does not work
When changing the photosID
to an album ID posting does not work.
I did a little research and it is mentioned that I need the page access token. I try this by:
FacebookClient fb = new FacebookClient(userAccessToken);
fb.AppId = APPID;
fb.AppSecret = SECRETID;
fb.AccessToken = userAccessToken;
Dictionary<string, object> fbParams = new Dictionary<string, object>();
dynamic publishedResponse = fb.Get("/me/accounts", fbParams) as JsonObject;
But the respsonse gives me not the accounts of the pages of the user. Do I need any specific permissions for this or what am I doing wrong?
回答1:
One need the extended permissions "manage_pages" and "publish_actions" to post a picture to a facebook album!
来源:https://stackoverflow.com/questions/23758163/post-picture-to-facebook-page-album