如何检索我刚刚通过Facebook API发布的帖子的帖子ID

med*_*pir 0 html php facebook facebook-graph-api

我使用以下代码发布到页面的feed连接

    $attachment = array('message' => 'xxxxxxxxxxxxxxxxx',
            'name' => 'cccccccccccccccc',
            'caption' => 'cccccccccccccccc',
            'link' => 'http://apps.facebook.com/manydldotnet/',
            'description' => "ccccccccccccc",
            'picture' => "'cccccccccccccccc'",
            'actions' => array(array('name' => 'Download!','link' => 'http://apps.facebook.com/manydldotnet/'))
            );

$result = $facebook->api('/121468571287906/feed/','post',$attachment); 
Run Code Online (Sandbox Code Playgroud)

所以问题是如何在发布后获得post_id?

ben*_*nck 6

帖子的id存储在$result['id'].

这是调用的返回值feed; 这也是案例/links,/photos等等.

参考:http://developers.facebook.com/docs/reference/php/facebook-api/