Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook Graph API returns 'false' even though post is public

In my application, most public posts seem to return 'false' when accessed via the Graph API.

Example: https://graph.facebook.com/1543370206_2215254431220?access_token=XXXX

That post is publicly visible, yet querying the above always returns false.

As per similar questions on StackOverflow, I've tried using both an application access token and several different oAuth 2.0 user access tokens with offline_access, but without success.

I've also tried accessing it using the profileid_postid ID format (as above) and postid format (https://graph.facebook.com/2215254431220?access_token=XXXX), but no luck.

I've also retried after 24 hours, just to be sure I'm not exceeding any API limits.

I have tested more than 1,000 public posts (I know they're public because I obtained them from the Graph API using the search method, but I've also done some random sampling in a browser to be sure). 75% returned false (regardless of whether I used an application access token or a user access token).

like image 972
Cam Price-Austin Avatar asked Aug 11 '11 05:08

Cam Price-Austin


1 Answers

I think I've solved it.

The posts which were returning false aren't 'public' as such. They seem to be visible to any Facebook user, regardless of whether they're friends with the author. However, if you're not logged into Facebook, you can't see them.

The posts which were succeeding were truly public. Most of them belonged to companies etc and you could see them whether you were logged into Facebook or not.

I guess the Graph API makes a distinction between these two types of visibilities e.g. 'Everyone on Facebook' and 'Everyone on the Internet'. I had a look in my privacy settings and can't figure out how this has been done.

Regardless, this isn't well-documented in the Graph API docs. Nor is returning 'false' an elegant way to handle this error. Nor is it consistent to allow me to see the post via search, but not query the object directly.

like image 116
Cam Price-Austin Avatar answered Nov 15 '22 07:11

Cam Price-Austin