How to get user posts using Graph API?

前端 未结 2 591
时光取名叫无心
时光取名叫无心 2021-01-05 04:44

I want to fetch all the public posts from a user\'s wall with my user access token. I know that read_stream permission is required for this. However this permission has been

2条回答
  •  耶瑟儿~
    2021-01-05 05:26

    /me/feed gives you posts published by this person.

    Filtered versions are:

    /me/posts shows only the posts published by this person.

    /me/tagged shows only posts that this person is tagged in.

    Your app needs user_posts permission from the person who created the post or the person tagged in the post.

    Then your app can read:

    Timeline posts from the person who gave you the permission. The posts that other people made on that person Timeline. The posts that other people have tagged that person in.

    If you attempt to read data from a feed that your app has not been authorized to access, the call will return an empty array.

    For more details: https://developers.facebook.com/docs/graph-api/reference/v2.5/user/feed

    Edit : From a user access token, you can only get feed of that user and his facebook friends who are users of this app. Also all those users must grant user_posts permission to your app otherwise it will return only empty data set like in your case

    For other users ( who have granted user_posts permission and friend of current access token user ) feed use: /{user_id}/feed

    {user_id} of friends ( who are also user of your app ) available in /me/friends

提交回复
热议问题