Reputation: 759
I'm using the Facebook send dialog to send links to Facebook posts. But I get the following error back from the Facebook API:
API Error Code: 100 API Error Description: Invalid parameter Error Message: 'link' is invalid.
This is the JavaScript:
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
// assume we are already logged in
FB.init({appId: '569858063028330'});
FB.ui({
method: 'send',
link: 'https://www.facebook.com/benjerryuk/posts/10151500944440101'
});
</script>
You can run it here: http://jsbin.com/welcome/62834/edit
Facebook send dialog documentation: https://developers.facebook.com/docs/reference/dialogs/send/
Upvotes: 0
Views: 901
Reputation: 51
I couldn't find it written specifically, but from my attempts it seems that facebook does not accept links to itself for some reason - I can't confirm this, but I got the same result even when I put links of public posts or profiles.
You might have the link refer to your app, which will redirect to the correct facebook post.
Another note: while showing this dialog, facebook loads the given link with AJAX, which means that A) it must be an active URL and B) you cannot use localhost.
Hope that helps.
Upvotes: 2