How to receive messages that a friend publishes using FQL?

I ran into the following problem. I would like to know how to get all the messages that were sent by my friend using FQL. I am using the following query:

SELECT post_id, type, source_id, actor_id, target_id, via_id, app_id FROM stream WHERE source_id=<friend_id> AND via_id LIMIT 0,100 

but unfortunately it returns an empty list. At the same time, when I execute the following query for my account, I get a list:

 SELECT post_id, type, source_id, actor_id, target_id, via_id, app_id FROM stream WHERE source_id=me() AND via_id LIMIT 0,100 

I created a token for all possible permissions. Can someone please tell me how to solve this problem?

+4
source share
3 answers

Your both questions are correct.

 SELECT post_id, type, source_id, actor_id, target_id, via_id, app_id FROM stream WHERE source_id=<friend_id> AND via_id LIMIT 0,100 

Only through the API can you not access users from depth 2 . For example, you cannot find your friend’s friend list.

If one of your friends shares one of your friends, you will see one result. If one of your friends shared a random user, then there are no results.

For privacy reasons, the API only allows you to access information in a rather closed circle of friends.

+2
source

Yeh .. I was also interested in this for some time.

Using the Graph API, we can get all the links that I have shared.

 GET me/links?fields=link 
0
source

Try the following:

 SELECT via_id, link_id, caption, url FROM link WHERE owner={user_id} 

via_id will show you the unique poster id of the source link. If via_id = 0, you are the original linkposter.

At least it will work for links.

0
source

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


All Articles