如何使用图API在未来日期发布新Feed。如果我在发布中添加日期,其投掷错误为"消息:(#100)发布的Param必须是布尔值"
if ( $session ) { try {
$request = new FacebookRequest(
$session,
'POST',
'/me/feed',
array (
'message' => 'Hi friends .... ',
'published' => "26/07/2015",
)
);
$response = $request->execute();
$graphObject = $response->getGraphObject();
/* handle the result */
echo "<pre>"; print_r($graphObject); echo "</pre>";
} catch(FacebookRequestException $e) {
// echo "Exception occured, code: " . $e->getCode();
echo " with message: " . $e->getMessage();
}
}
答案 0 :(得分:0)
嗯,published
字段是布尔值,因此它只能是true
或false
。
顺便说一下,只有页面可以安排帖子,published
没有/me/feed
参数:https://developers.facebook.com/docs/graph-api/reference/v2.4/user/feed#publish
对于页面,您可以将published
设置为true并在scheduled_publish_time
字段中使用日期:https://developers.facebook.com/docs/graph-api/reference/v2.4/page/feed#publish