简体   繁体   English

如何仅从Facebook Graph API获取私人帖子

[英]How to get private posts only from Facebook Graph API

I would like to obtain private posts from my profile's wall - without public ones. 我想从个人资料墙上获取私人帖子-不公开。

With full-permission token, 有了全权限令牌,

https://graph.facebook.com/MickeySpencerShow_ID/posts

returns all posts - public and private. 返回所有帖子-公共和私人。

Is there any way to filter them? 有什么办法可以过滤它们?

Yes, with FQL, for example this query looks for private comments under given post: 是的,对于FQL,例如,此查询在给定帖子下查找私人评论:

SELECT id, post_id, parent_id, is_private 
  FROM comment
 WHERE post_id='XXXXXX' AND is_private=1

Yes, there is a way to filter them, but not by using permissions. 是的,有一种方法可以过滤它们,但不能使用权限。 You need to write your own code. 您需要编写自己的代码。 According to the documentation for the Posts graph object , there is a privacy attribute that will be set to EVERYONE, ALL_FRIENDS, NETWORKS_FRIENDS, FRIENDS_OF_FRIENDS, or CUSTOM. 根据Posts图形对象文档 ,存在一个隐私属性,该属性将设置为EVERYONE,ALL_FRIENDS,NETWORKS_FRIENDS,FRIENDS_OF_FRIENDS或CUSTOM。 That should get you started. 那应该让您开始。 Also, using Simon Cross' Graph Explorer tool , you can play around with different permissions and see the actual field values, without having to write code. 同样,使用Simon Cross的Graph Explorer工具 ,您可以使用不同的权限进行操作,并查看实际的字段值,而无需编写代码。

It seems like you are expecting permissions to filter the results. 似乎您希望获得过滤结果的权限。 That's not what permissions are for. 那不是权限的用途。 More permissions will add more data to your result set. 更多权限将为您的结果集中添加更多数据。 Default is public posts. 默认为公开帖子。 Getting permissions to access the private posts means that https://graph.facebook.com/me/posts will return the public + private posts. 获得访问私人帖子的权限意味着https://graph.facebook.com/me/posts将返回公共+私人帖子。 Maybe you should also be looking at the documentation for the User graph object to understand how permissions work. 也许您还应该查看User图形对象的文档,以了解权限的工作原理。

忘记像在使用SQL一样在facebook图表上进行查询...他们在FB使用的确实是NOSQL的Cassandra ...碰巧在文档上发现可以查询某些特定的“键”值,但从未见过无论如何,您应该在此处仔细检查隐私权https://developers.facebook.com/docs/reference/api/post/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM