【问题标题】:posting an event to facebook using an application token using c#使用 c# 使用应用程序令牌向 facebook 发布事件
【发布时间】:2013-09-19 17:47:38
【问题描述】:

我一直在为某些事情而苦苦挣扎,但我似乎错过了一些东西。我想使用我的 Facebook appid / appsecret 将活动发布到 Facebook。这些事件应该归应用程序所有,而不是任何用户。我尝试这样做:

 var fc = new FacebookClient();
 fc.AppId = "myappid";
 fc.AppSecret = "myappsecret";

 //get a token
 dynamic result = fc.Get("oauth/access_token", new
 {
     client_id = fc.AppId,
     client_secret = fc.AppSecret,
     grant_type = "client_credentials"
 });

 //use the token to post to FB?
 fc = new FacebookClient(token);
 JsonObject json = new JsonObject();
 json.Add("name", HtmlUtils.StripHtmlTags(@event.Title));
 json.Add("description", HtmlUtils.StripHtmlTags(@event.Description));
 json.Add("start_time", @event.StartDate.ToString("yyyy-MM-dd HH:mm"));
 json.Add("no_feed_story","true");

 //here i get an error
 var id = fc.post("/myappid/events",json);

(OAuthException - #1) 发生未知错误。

我做错了什么?我的应用也没有处于沙盒模式。

【问题讨论】:

    标签: c# facebook facebook-graph-api facebook-c#-sdk


    【解决方案1】:

    你用过——

    \POST /myappid/events
    

    这是一个无效请求。活动发布在用户页面粉丝页面 *通过*应用程序。

    没有什么比“在应用程序上发布活动”更好的了

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-08-27
      • 2015-02-08
      • 1970-01-01
      • 1970-01-01
      • 2014-10-23
      • 1970-01-01
      相关资源
      最近更新 更多