Reputation: 3594
I'm playing around with the Facebook API, and have gotten far enough to get the access token into my app, but when I go to actually send a post to my Facebook wall I get the error message, {"error":{"message":"(#100) You can't post this because it has a blocked link.","type":"OAuthException","code":100}}1
I'm not attempting to send any kind of link, just "Hello, World!" so this seems pretty weird to me :\ Here's my code so far:
$content = urlencode("Hello, World!");
$accesstoken = urlencode($row['fbid']);
$result = getPageWithPOST("https://graph.facebook.com/me/feed", "access_token=" . $accesstoken . "&message=" . $content);
echo $result;
where getPageWithPOST is,
function getPageWithPOST($url, $posts) {
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $url);
curl_setopt($c, CURLOPT_POST, true);
curl_setopt($c, CURLOPT_POSTFIELDS, $posts);
$content = curl_exec ($c);
curl_close ($c);
return $content;
}
thanks!
Upvotes: 0
Views: 414
Reputation: 17720
Firstly, I suggest you download and use the PHP SDK as it'll save you lost of hassles for many functions: http://developers.facebook.com/docs/reference/php/. Then there's a perfect eaxmple to copy on the following page: http://developers.facebook.com/docs/reference/php/facebook-api/
But to directly answer the query: there doesn' appear anythign concrete on this error, but suggestiosn are that the server that you are posting from is probably blocked by Facebook - possibly a shared server that's been "banned" by Facebook? Try on a different server to see if you get better results.
Upvotes: 1