简体   繁体   中英

Facebook c# sdk error OAuthException - #2

I am trying to publish a post on my Facebook page and I receive this error

(OAuthException - #2) An unexpected error has occurred. Please retry your request later.

  FacebookClient app = new FacebookClient(accesstoken);
      
      var result = app.Post("/" + model.pageId + "/feed", messagePost);
dynamic messagePost = new ExpandoObject();
            //messagePost.access_token="accesstoken";
            messagePost.picture = "https://miro.medium.com/max/1200/1*mk16aYaf_Bes1E3Imhc0A.jpeg";
            messagePost.link = "https://exemple.com/";
            //messagePost.name = model.titre;
            //messagePost.caption = "this post was created by my website";
            messagePost.message = "test_message";


FacebookClient app = new FacebookClient(accesstoken);
      
      var result = app.Post("/" + model.pageId + "/feed", messagePost);

the problem was i give facebook the access token 2 times and that confuses facebook api i just removed messagePost.access_token and it works fine

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM