如何使用c#和facebook API在facebook组中发布状态?

时间:2015-05-18 13:01:35

标签: c# asp.net vb.net facebook facebook-graph-api

我可以发布到Facebook墙,但我应该如何在群组中发布状态?

 public void Wall_Post_Publish() 
 { 
 FacebookClient app = new FacebookClient(); 
  dynamic parameters = new ExpandoObject(); 
    parameters.access_token =     ConfigurationManager.AppSettings["AccessToken"]; 
    parameters.message = "This is a test message that has been published by     the Facebook C# SDK on Codeplex. " + DateTime.UtcNow.Ticks.ToString(); 
    parameters.attribution = "Facebook C# SDK"; 

   dynamic result = app.Post("/me/feed", parameters); 

  Assert.NotEqual(null, result.id); 
 }

但如何在群组中发布

1 个答案:

答案 0 :(得分:0)

您只需要使用组ID而不是“我”:

dynamic result = app.Post("/group-id/feed", parameters); 

请注意,您需要publish_actionsuser_groupsuser_managed_groups才能发布到论坛。 user_groups不会获得批准,因此您最好使用user_managed_groups

来源:https://developers.facebook.com/docs/graph-api/reference/v2.3/group/feed#publish