Extend Facebook Open Graph Token For Posting to Pages

后端 未结 2 1690
北海茫月
北海茫月 2021-02-04 22:28

I\'m using this tutorial (from the first answer on that page).

In short it uses a FB app, and PHP CURL GET to post to your Facebook page via HTTP. I have it working and

相关标签:
2条回答
  • 2021-02-04 23:24

    The & symbol should be replaced with ? (question mark). Then it should work.

    ex:

    https://graph.facebook.com/oauth/access_token?grant_type=fb_exchange_token&client_id={app-id}&client_secret={app-secret}&fb_exchange_token={short-lived-token}
    
    0 讨论(0)
  • 2021-02-04 23:25

    You get your page access token when you (the admin user) authenticate. The page token is based on your short-lived user token. In order to get a long-lived page token you need to get a long-lived user token. They usually last around two months.

    Here's how you get a long-lived page token.

    1. Get a short-lived user token.
    2. Get your app ID and app secret.
    3. Make the following GET call: https://graph.facebook.com/oauth/access_token&grant_type=fb_exchange_token&client_id={app-id}&client_secret={app-secret}&fb_exchange_token={short-lived-token}.
    4. Now use the token returned from step 3 to create a new long-lived page token.
    0 讨论(0)
提交回复
热议问题