Facebook 错误 #100:如果提供图片 URL,则必须提供 link

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

我几个月前开发了一个页面,可以在我的 2 个 Facebook 页面上自动 post。我可以 post 只是一条消息,但也可以添加 link and/or 图片。 一切都很顺利,我最近的 post 于 11 月 25 日成功。 今天,我尝试发布一条只有图片的新闻,但收到一条错误 100# 消息,上面写着:"A link must be provided if a picture URL is given".

我找不到关于这个主题的任何解释或帮助。 Facebook 似乎更改了有关图片发布的规则。

基本上这里是错误转储:

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

唯一改变的是我必须更改我的 FB 密码。所以我的 access_token 不再有效,我生成了一个新的。 我使用相同的过程来获得这个新的 access_token,并且我可以在 Pages 上 post。但是再一次,只有文字和 link,但不再有图片。

另一个信息:我尝试重新post 与 11 月 25 日 post 编辑的同一张照片,但出现错误。所以这绝对不是图片错误 URL 或图像本身的错误。

提前致谢

https://developers.facebook.com/docs/graph-api/reference/v2.5/page/feed#publish

发布图片需要 link - 图片实际上是 "preview image associated with the link"。如果你想 post 没有 link 的图片,你也可以 post 到 /page-id/photos 端点。

这不是你的错,Facebook 改变了一些关于 post 的东西。 这也发生在我身上..我和你处于同样的情况..有几个月的工作脚本,突然发布 posts 没有 links 不再工作了. 除了 post 带有 link ...

的图片,我找不到任何其他解决方案

解决方案:到目前为止,如果未指定 link,Facebook 会使用实际图像 src 作为 link,因此您可以做的是添加特定的 link在您的 posting 工具中,如果未指定实际 link

我知道这是旧的,但除了已接受的答案 /page-id/photos 提到的端点之外,您还需要使用 fileToUpload 方法设置 sourcehttps://developers.facebook.com/docs/php/FacebookFile/5.0.0

我自己解决了这个问题 - 不要从菜单中选择条目;而是自己输入 {{product.url}}。