2012-02-28 278 views
0

我正在開發一款應用程序,使我可以通過我的網絡應用程序發佈到羣組的牆上。但我得到以下錯誤:(OAuthException)發生意外的錯誤。請稍後重試您的請求。Facebook API錯誤:(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=以下結果 「我的令牌」

{ 
"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 
    } 
]} 

我錯過任何其他權限?

回答

0

代碼中的所有內容似乎都是正確的。如果你有一個有'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上創建一個錯誤作爲你上面的代碼應能正常工作。

+0

任何跟進?我現在有同樣的錯誤,而且兩天前工作。 (OAuthException)發生意外錯誤。請稍後重試您的請求 – Marco83 2013-04-24 18:33:27