How to get public wall posts with the facebook API

前端 未结 2 1769
甜味超标
甜味超标 2020-12-24 09:09

I m trying to get wall posts from a profile facebook. I have no problems with the fan pages and my user token is valid (at least for the fan pages).

Example with thi

2条回答
  •  旧时难觅i
    2020-12-24 09:43

    EDIT

    This answer was written back when the Graph API version was in its first version. Back then you could get the user feed by using the user ID, right now the user ID is no longer shared between apps. Also facebook created a new API that it's only available to some of it's partners.

    So right now it's impossible for you to get the public user feed, unless the user has used your app. You can still get the Pages feed though.

    Old version

    This answer was for graph api v1

    So you must use this https://graph.facebook.com/529628444?fields=feed&access_token=YOUR_TOKEN

    And if all you want is query public data you can create a APP Token by doing this:

    https://graph.facebook.com/oauth/access_token?
    client_id=YOUR_APP_ID&client_secret=YOUR_APP_SECRET&
    grant_type=client_credentials 
    

    And use this token instead of using your user token.

提交回复
热议问题