Facebook Graph API returns false, although posting is public

In my application, most public messages seem to return false when accessed through the Graph API.

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

This post is publicly available, but a query to the above always returns false.

In accordance with similar questions in StackOverflow, I tried using an application access token and several different oAuth 2.0 access tokens using offline_access, but without success.

I also tried to access it using the profileid_postid identifier format (as mentioned above) and the postid format (https://graph.facebook.com/2215254431220?access_token=XXXX), but no luck.

I also retried after 24 hours, just to make sure that I did not exceed the API limits.

I tested over 1000 public messages (I know that they are publicly available because I got them from the Graph API using the search method, but I also made some random selections in the browser to make sure). 75% returned false (regardless of whether I used the application access token or user access token).

+6
source share
3 answers

I think I decided.

Posts returning false are not "public". They appear visible to any Facebook user, regardless of whether they are friends with the author. However, if you are not logged into Facebook, you cannot see them.

The posts that succeeded were truly public. Most of them belonged to companies, etc., and you could see them whether you were registered on Facebook or not.

I think the Graph API makes a distinction between these two types of visibility, for example. "Everything on Facebook" and "Everything on the Internet." I looked in the privacy settings and cannot figure out how this was done.

Despite this, this is not documented in Graph API documents. Nor does it return a β€œfalse” elegant way to handle this error. It is also inconsistent with the fact that I could see mail through a search, but did not request the object directly.

+9
source

I know this question is more than one year old - but Graph will return the correct object if you use the page access token.

You get them by asking the user for MANAGE_PAGES permission, and then getting a connection / user account. Each record in the connection will contain a page access identifier and a page access token - this token will allow you to extract all page objects from the chart. If you use your application token or user token, it will return false .

+1
source

You should consider submitting a bug report to Facebook. To add to the problem, I noticed that these public messages return only false if they are messages from a custom object. Page posts work as expected. You are not doing anything wrong, as it happens in the Facebook API Google APIs (this is an example that Facebook provides in its document API for requests for public messages).

0
source

Source: https://habr.com/ru/post/894788/


All Articles