Question

Thanks for the help. I am having some troubles posting a link to a facebook page. It gets called from a MVC website running an Umbraco installation. To post I am using the official facebook SDK for the .NET framework.

It worked perfectly the last 6 months until I started receiving the following error: "(OAuthException - #2) An unexpected error has occurred. Please retry your request later." And the full stack trace:

   at Facebook.FacebookClient.ProcessResponse(HttpHelper httpHelper, String responseString, Type resultType, Boolean containsEtag, IList`1 batchEtags)
   at Facebook.FacebookClient.Api(HttpMethod httpMethod, String path, Object parameters, Type resultType)
   at Facebook.FacebookClient.Post(String path, Object parameters)
   at WebsiteFixit.BLL.FacebookPoster.Post(String message, String link, Int32 newsItemId) in d:\Users\Documents\Freelance\Cereus\Fixit Website On Launch\Fixit Website_SVN\WebsiteFixit.BLL\FacebookPoster.cs:line 41

I find it rather awkward because nothing has changed on the code and it suddenly stopped working. I use the following code to post a link onto a facebook page via the graph api:

var fb = new FacebookClient();    
dynamic result = fb.Post(PageId + "/links", new
                {
                    access_token = AccessToken,
                    link = url,
                    message = message
                });

It's returning this error for a full month now. I didn't know what to do. Does anyone have solution for this problem?

Edit: I have checked the validity of my accesstoken through the Graph API Explorer.

Was it helpful?

Solution 2

The solution to the problem was the link to where the post happened. Because of a change in the Graph API the it should be posted to /feed var fb = new FacebookClient();

dynamic result = fb.Post(PageId + "/feed", new
                {
                    access_token = AccessToken,
                    link = url,
                    message = message
                });

OTHER TIPS

I actually don't know if this would help, but once I was getting errors and I discovered that Facebook returns an error if the post was duplicated, so if you're trying to send the same link you probably would get an error even if you deleted this post, it would still see it as duplicate, so try posting something else and see if this'd work

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top