在业务页面上发布定期发布的Facebook Graph API错误

问题描述:

我正在使用Facebook php图表API,我一直在尝试发布一个预定的帖子到商业页面,但没有运气,但是,我可以成功地在同一页面上发布已发布的状态。

I am using Facebook php graph api and I've been trying to post a scheduled post to a business page but with no luck, However, I can successfully post a published status on the same page.

我已经阅读FB API,要发布计划状态,我必须在发送POST请求时将变量已发布设置为false。但是当我这样做时,我会收到以下异常:

I've read in the FB API, that to post a scheduled status I must set the variable "published" to false when sending the POST request. However when I do this I get the following exception thrown:

FacebookApiException
An unexpected error has occurred. Please retry your request later.

POST 请求如下所示:

["\/11111111111111\/feed", "POST", {
    "access_token": "xxxxxx",
    "message": "Test message",
    "picture": "http://working.picture.path.com/pic.jpg",
    "published": false,
    "scheduled_publish_time": 1401406920
}]

此后,我尝试删除已发布变量,并得到这个错误:

After this, I've tried remove the "published" variable and got this error:

(#100) You cannot specify a scheduled publish time on a published post 

几天后我尝试了相同的代码,所以这不是Facebook的临时问题...我试图设置已发布变量为 int 0, bool false, string 'false'和 string '0'。但是我得到了同样的错误..

I tried the same code after a few days so this is not facebook's temporary problem... I've tried to set the "published" variable to int 0, bool false, string 'false' and string '0'. But I am getting the same error..

我发现问题....

问题是由picture变量引起的。显然,你不能使用图片变量没有链接,当你这样做,你尝试发布状态为未发布,它会失败与未知的错误。然而,由于某些原因,如果已发布= true,它将与图片一起使用,并发布没有链接的图像。

The problem was caused by the "picture" variable. Apparently you cannot use the "picture" variable without "link", when you do this and you try to post the status as Unpublished, it will fail with an unknown error. However, for some reason, if published = true, it will work with picture and post an image without a link.