且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用Graph API获取用户的帖子?

更新时间:2023-01-29 18:30:38

/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

相关阅读

技术问答最新文章