What are the Steps to getting a Long Lasting Token For Posting To a Facebook Fan Page from a Server

Here are some steps you can follow to get a never expiring token for your fan page:

  1. Firstly, you need to get the long lived user access token (that expires in 2 months). To get this, make the following call:

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

    More details here. Let me know if you had any difficulty with this.

  2. Get the never expiring access token for your page using the token you obtained in the above step (not the normal token, that’s the main difference here):

    $facebook->api("/PAGE_ID?fields=access_token");
    

So the concept is, to get the long lived page token you should use the long lived user token while making the call.

Leave a Comment