How to generate a long-lived token for posting information on facebook

0

I am trying to generate a token for posting information on facebook on my page with php the script until posting but the token that I can get is only one hour old.

How do I create a token that has undefined time or re-update the token automatically? I'm using facebook's link

but I can not generate any token with more than 1 hour.

    
asked by anonymous 02.10.2017 / 00:28

1 answer

1

1 - You can renew your "short-lived-token";

2 - From your "short-lived-token" you can get a long-lived-token with the endpoint:

GET /oauth/access_token?  
grant_type=fb_exchange_token&           
client_id={app-id}&
client_secret={app-secret}&
fb_exchange_token={short-lived-token} 

Documentation: link

    
02.10.2017 / 01:55