Ad

Getting Public Facebook Posts With An App Token

I'm using the facebook graph api to access publicly posted information of an arbitrary user. I'm using my own profile for testing and have posted a single public post.

The endpoint that I'm using is:

https:graph.facebook.com/v2.4/{id}/feed

However, this endpoint returns an empty set of data:

{
  "data": [
  ]
}

This occurs regardless of which type of access token I use. I've tried an app access token, a regular access token with no additional permissions, and a regular access token with 'user_posts' selected. I'm especially confused about receiving no data with the last access token as that should include all posts that I've made.

I'd much prefer to use an app access token if possible - it's much easier to get a new one than it is to prompt a user to allow access. What am I doing wrong here?

Ad

Answer

This can't be done for all users. Facebook requires a person to be logged in order to see public posts from certain users. App credentials won't work to see an arbitrary user's public posts.

Ad
source: stackoverflow.com
Ad