Facebook wall post error: OAuthException :: (#1500) The url you supplied is invalid Facebook wall post error: OAuthException :: (#1500) The url you supplied is invalid heroku heroku

Facebook wall post error: OAuthException :: (#1500) The url you supplied is invalid


I'm having the same issue only difference is I'm using the javascript api.

Seems like it's a facebook bug, which is already reported here: https://developers.facebook.com/bugs/136768399829531


Yes this is a known bug and Facebook developers are looking into it, well so they claim,however something interesting I found out is:

I post to my Facebook using 2 methods using RestFB API , first, for messages with URLs e.g www.something.com and those without URLs, I realized last night that all posts without URL worked and the ones with URL doesn't.

So I changed all my implementation to send messages to Facebook without using with link parameters for all posts, with or without links.

With link Parameter - throws error #1500

FacebookType publishMessageResponse = resftFBclient.publish(FACEBOOK_PAGE_ID +"/feed", FacebookType.class, Parameter.with("message", "Hello StackOverFlow!"),Parameter.with("link", "message with a link , www.me.com"));

With no link parameter - this works even if message contained URL/link

FacebookType publishMessageResponse = resftFBclient.publish(FACEBOOK_PAGE_ID. +"/feed",FacebookType.class,Parameter.with("message", "My message"));

This works even if message contained URL/link and it creates an clickable link on FB. Could it be that FB is trying to drop the link implementation and letting us figure it out that the former works just as the link implementation? What's the difference anyways?

That's brutal!

Cheers

Babajide


I was trying to solve this problem this problem that seems to be occurring to almost everyone. I am using the PHP SDK.

What I noticed is that it always returned this error for the first time I tried to post the link. On a second try, it was posted with success.

Really hackishly I then checked for an error and retried to post to the wall.

$errorCount = 0;function postPicture($phrase){    try    {      $image = $_SESSION['photoLink'];      $facebook->setFileUploadSupport(true);      $response = $facebook->api(        '/me/feed',        'post',        array(          'message' => $phrase,          'picture' => 'http://mylink/pictures/facebook.png',          'link' => $image,          'caption' => 'My caption',          'description' => 'My description',           'type' => 'photo',          'name' => 'My name'        )      );      echo 'Success';      }    }    catch (FacebookApiException $e)    {      // You really should check if this $error is #1500 before doing that. I didn't :)      if($errorCount < 2)      {        postPicture($phrase);        $errorCount++;      }      else      {          $e = str_replace('"', "", $e);          $e = str_replace("'", "", $e);          echo 'Error ' . $e;      }   }}