'Facebook Error #100 : A link must be provided if a picture URL is given

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



Solution 1:[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:[2]

I solved the problem for myself - do not choose the entry from the menu; instead type {{product.url}} yourself.

Solution 3:[3]

This is not your fault, Facebook changed something regarding to the posts. This happened to me as well .. I was in the same situation as you were .. had a working script for months, and all of a sudden publishing posts without links didn't work anymore. I could not find any other solution than to post the picture with a link ...

SOLUTION: Until now, if no link was specified, Facebook would of used the actual image src as the link, so what you can do is add that specific link in your posting tool if no actual link is specified

Solution 4:[4]

I know this is old but in addition to the endpoint mentioned by the accepted answer /page-id/photos you need to set the source with the fileToUpload method: https://developers.facebook.com/docs/php/FacebookFile/5.0.0

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 andyrandy
Solution 2 user18863987
Solution 3
Solution 4 Uriahs Victor