如何检索我刚刚通过 Facebook API 发布的帖子的帖子 ID
我正在使用以下代码发布到页面的 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);
所以问题是如何在发布后获取 post_id ?
i am using the following code to publish to a Page's feed
connection
$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);
so the question is how to get the post_id after posting it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
帖子的 ID 存储在
$result['id']
中。它是调用
feed
的返回值;/links
、/photos
等也是如此。参考:http://developers.facebook.com/docs/reference/php/facebook-api/
The Post's id is stored in
$result['id']
.It's the return value of the call to
feed
; this is also the case for/links
,/photos
, etc.Ref: http://developers.facebook.com/docs/reference/php/facebook-api/
检查 $result 变量中的值,它应该是实际的 post_id 值。
Check the value in the $result variable, that should be the actual post_id value.