Search code examples
facebookfacebook-graph-apiposts

Access visible posts ONLY with facebook graph


I am new to facebook graph. I manage to access all the posts using:

https://graph.facebook.com/THEPAGE/posts?access_token=MYTOKEN

But this list all posts. How to get visible posts only? Or how to determine if post is hidden on the page?

Thanks!


Solution

  • As long as you've requested the read_stream permission, every post object will include a privacy field which specifies who can view that post. You can filter the posts on the client based on this field.

    You're probably only interested in the value field of the privacy specification, which is one of EVERYONE, ALL_FRIENDS, FRIENDS_OF_FRIENDS, CUSTOM, or SELF. For example, posts which are visible to everyone will have {"value":"EVERYONE"} in the privacy field.