Facebook Error #100 : A link must be provided if a picture URL is given
Solution 1
https://developers.facebook.com/docs/graph-api/reference/v2.5/page/feed#publish
Posting a picture requires a link - the picture is actually the "preview image associated with the link". You can also post to the /page-id/photos
endpoint if you want to post a picture without a link.
Solution 2
I solved the problem for myself - do not choose the entry from the menu; instead type {{product.url}} yourself.
Pierrot
Updated on November 29, 2022Comments
-
Pierrot over 1 year
I developped months ago a page to automatically post on my 2 Facebook pages. I could post just a message but also add a link and/or a picture. Everything worked like a charm and my latest post was succesfull the 25th of Nov. Today, I try to publish a news with just a picture and I received an error 100# message which says : "A link must be provided if a picture URL is given".
I can't find any explaination nor help on this subject. It seems that Facebook changes its rules concerning the publication of pictures.
Basically here is the error dump :
FacebookApiException Object ( [result:protected] => Array ( [error] => Array ( [message] => (#100) A link must be provided if a picture URL is given. [type] => OAuthException [code] => 100 [fbtrace_id] => xxxxxxxxxxxx ) ) [message:protected] => (#100) A link must be provided if a picture URL is given. [string:Exception:private] => [code:protected] => 0 [file:protected] => /mypathtofacebook/base_facebook.php [line:protected] => 1042 [trace:Exception:private] => Array ( [0] => Array ( [file] => /mypathtofacebook/base_facebook.php [line] => 747 [function] => throwAPIException [class] => BaseFacebook [type] => -> [args] => Array ( [0] => Array ( [error] => Array ( [message] => (#100) A link must be provided if a picture URL is given. [type] => OAuthException [code] => 100 [fbtrace_id] => xxxxxxxxxxxxxxxxx ) ) ) ) [1] => Array ( [function] => _graph [class] => BaseFacebook [type] => -> [args] => Array ( [0] => /mypageid/feed [1] => post [2] => Array ( [access_token] => myaccesstoken [from] => myAPPid [message] => blabla [picture] => http://www......................jpg [to] => mypageid
The only thing that changed is that I had to change my FB password. So my access_token was no longer valid and I generated a new one. I used the same process to get this new access_token and I can post on Pages. But once again, only text and link, but no picture alone anymore.
Another info: I try to repost the same picture that the one posted the 25th of Nov and I have the error. So it's definitely not an error in the picture URL or in the image itself.
Thanks in advance
-
Pierrot over 8 yearsThanks luschn but I don't agree. I think this page is not the good one for my problem. No "picture" param is available. Moreover, it says in the link field : "Either link or message must be supplied". And I supplied a message. And once again, everything worked perfectly for months ! :(
-
CBroe over 8 years@Pierrot: “I think this page is not the good one for my problem. No "picture" param is available” – next to
link
there’s a downward arrow – be spontaneous and adventurous, and risk a click on that … ah, see,picture
is listed belowlink
! And yes, that means it is only a valid parameter if you also provide a link value. -
Pierrot over 8 yearsArgh sorry. I watch Facebook on my cellphone so I didn't notice the arrow. I'm stunned because it had worked. I have many examples on my FB page ! I'm going to check that tonight at home. It must have an explanation. I'll be back to you ASAP. Thanks
-
Pierrot over 8 yearsOK, I surrender :) I don't understand what's happened. Either the change of my access_token did something, or FB corrected a bug in its API (allowed picture without a link). As my code didn't change since the begininng of November there is no other explanation. I validate luschn's answer. Thanks