Facebook图形api在未来日期发布饲料

时间:2015-07-25 08:34:47

标签: facebook facebook-graph-api facebook-php-sdk

如何使用图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();
    }
}

1 个答案:

答案 0 :(得分:0)

嗯,published字段是布尔值,因此它只能是truefalse

顺便说一下,只有页面可以安排帖子,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