【问题标题】:Facebook API error: (OAuthException) An unexpected error has occurred. Please retry your request laterFacebook API 错误:(OAuthException) 发生意外错误。请稍后重试您的请求
【发布时间】:2012-02-28 09:47:46
【问题描述】:

我正在开发一个应用程序,使我能够通过我的网络应用程序在 Group 的墙上发帖。但我收到以下错误:(OAuthException)发生意外错误。请稍后重试您的请求。

            var client = new FacebookClient("<my token>");
            dynamic parameters = new ExpandoObject();
            parameters.access_token = "<my token>";
            parameters.message = "testing";
            parameters.link = "http://www.example.com/article.html";
            parameters.picture = "http://www.example.com/article-thumbnail.jpg";
            parameters.name = "Article Title";
            parameters.caption = "Caption for the link";
            parameters.description = "Longer description of the link";
            parameters.actions = new
            {
                name = "View on Zombo",
                link = "http://www.zombo.com",
            };
            dynamic result = client.Post("/<group id>/feed", parameters);

我在https://graph.facebook.com/me/permissions?access_token="my token" 中得到以下结果

 {
 "data": [
  {
     "installed": 1,
     "status_update": 1,
     "photo_upload": 1,
     "video_upload": 1,
     "create_note": 1,
     "share_item": 1,
     "read_stream": 1,
     "publish_stream": 1,
     "manage_pages" : 1
  }
]}

我是否错过了任何其他权限?

【问题讨论】:

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


    【解决方案1】:

    您的代码中的所有内容似乎都是正确的。如果您拥有具有“publish_stream”权限的有效访问令牌,则此请求应该可以工作。我想知道的一件事是两次设置访问令牌是否会导致问题,但我查看了代码,看起来不应该。尝试将您的代码更改为以下示例,看看它是否有效。

    var client = new FacebookClient(); / Node no token in constructor
    dynamic parameters = new ExpandoObject();
    parameters.access_token = "<my token>";
    parameters.message = "testing";
    parameters.link = "http://www.example.com/article.html";
    parameters.picture = "http://www.example.com/article-thumbnail.jpg";
    parameters.name = "Article Title";
    parameters.caption = "Caption for the link";
    parameters.description = "Longer description of the link";
    parameters.actions = new
    {
        name = "View on Zombo",
        link = "http://www.zombo.com",
    };
    dynamic result = client.Post("/<group id>/feed", parameters);
    

    我们将在 SDK 中仔细检查这一点,但如果这对您有用,请在 github 上创建一个错误,因为您的上述代码应该可以正常工作。

    【讨论】:

    • 对此有任何跟进吗?我现在遇到同样的错误,两天前它还在工作。 (OAuthException) 发生意外错误。请稍后重试您的请求
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多