facebook send API Error Code: 100 API Error Description: Invalid parameter Error Message: 'link' is invalid

Priyank Gupta picture Priyank Gupta · Apr 19, 2013 · Viewed 34.9k times · Source

I am using facebook post GRAPH UI for posting private message with link to my application in facebook. Earlier it was working fine but from last two days the dialog started throwing error as :

An error occurred. Please try again later.

API Error Code: 100
API Error Description: Invalid parameter
Error Message: 'link' is invalid.

for sending message I am using code :

function sendMessage(id) {
  FB.ui({
    method : 'send',
    name : 'My APP',
    link : 'https://apps.facebook.com/MY_APP/',
    to : id,
    show_error : 'true',
    description : 'my description'
  });
}

I have Googled about this and only relevant information I get is that facebook is blocking the link to its own domain as to avoid spam. as I change the link to other live site its working.

I need to send link to my application as I have to provide such functionality.

Answer

Zach Lysobey picture Zach Lysobey · Aug 14, 2013

I've had similar issues, and figured I'd share the results of my investigation here.

The only information in the Facebook documentation describing the link parameter is not terribly helpful:

link -The URL that is being sent in the message.

There are a couple other StackOverflow questions similar / related to this one:

Facebook API Error 100 - invalid link

this problem ended up being a malformed picture parameter

Facebook FB.ui send dialog intermittently returns invalid link error -

"The issue revolved around our url being dynamic and needing force caching each time. I now make an ajax call to "https://developers.facebook.com/tools/debug/og/object" to refresh it and then launch the send dialog."

I still don't know precisely what constitutes a valid link parameter, but...

Making some inferences from the above questions & responses, as well as some testing on my part, valid link parameters:

  • Must be "fully qualified". I.E. containing http:// or https://
  • Must not be facebook.com links
  • Might not like redirects (or you have to be sneaky with them)
  • Do support URLs not in the "App Domains" list
  • Do support Query Strings
  • May be finicky regarding dynamically generated pages (as in this question)

Apparently Facebook has some sort of link crawling mechanism that performs some unknown tests on a link parameter to determine its validity. I only wish they would choose to document it for us.