Generate “never-expire” access token for Facebook Page

后端 未结 12 1859
猫巷女王i
猫巷女王i 2020-11-28 19:49

I have managed to post to Facebook Page via API (C#), but when administrator of the page logs out, the following error occurs:

\"(OAuthException - #190) Error valida

12条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-28 20:16

    You can use following api from facebook to refresh token life to 60 days and just when the token is about to expire, call the same api again with-in 60 days to refresh its life back to 60 days from that point of time Token expire is present in expires parameter and its value is in seconds

    Replace CLIENT_ID and CLIENT_SECRET with their actual value

    https://graph.facebook.com/oauth/access_token?client_id=
    &client_secret=&grant_type=fb_exchange_token
    &fb_exchange_token=
    

    in ACCESS_TOKEN, put the actual token value without appending "access_token="

提交回复
热议问题