Facebook Graph API and Generic Access token

前端 未结 4 464
鱼传尺愫
鱼传尺愫 2021-02-06 19:48

If I understand correctly, the Graph API enables access to public pages using a generic access token. I\'m finding however that many public pages are not returned in search resu

相关标签:
4条回答
  • 2021-02-06 20:24

    I dont think you can get this to work without a user access token. From my limited OAUTH is the only way forward.

    0 讨论(0)
  • 2021-02-06 20:33

    By specifying GRAPH API user token, you simply meant that you are using user preferences and information . if your intention is to fetch some public page information , then you need that page userid or username . And , if you are intention is to grab all the public data which is available for your particular user , then you have to pass oAUTH system,Since indirectly you are accessing his information which is meant public under some facebook govern rules .

    Accessing public page by providing user id

    https://graph.facebook.com/19292868552
    

    By writing the id of that page,you ca access its information. Now the question is how to access the id of that particular page, Manually just visit that page --> photo album . on the top of that page,you will see something like "Album Videos" . Just visit any of that link.now see,woola the id of that page is visible to you . something like this url

        http://www.facebook.com/media/albums/?id=176101909092314
    

    And btw,if you are interested in performing search , then you need to specify user token. facebook do some algorithmic search for all users and track user activities . So , the result will not always the same for you and me , as an example .

    0 讨论(0)
  • 2021-02-06 20:40

    I suspect you need a user access token to use /search as search results use social context. If you have the page id, you can load that without any access token by just hitting /id

    0 讨论(0)
  • 2021-02-06 20:43

    You can get a generic access token for your app that will let you look at requests where you would otherwise need an access_token= parameter in the Graph call. You don't need to authenticate users as the access token is for the application.

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

    example:

    https://graph.facebook.com/nike/posts?access_token={response from above call}
    
    0 讨论(0)
提交回复
热议问题