Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>OK I think I have finally found the way to do it. I needed a page access code and not an application access code. The token must be generated outside the application as a long live one.</p> <ul> <li>Get a code using:</li> </ul> <p><code>https://www.facebook.com/dialog/oauth?client_id={app_id}&amp;redirect_uri={my_url}&amp;scope=manage_pages,publish_stream</code></p> <p>app_id is your application ID my_url is your application URL scope is the permission you want to be granted</p> <p>In the redirected URL, you will have a code parameter. Copy it.</p> <ul> <li>Generate the user access code using:</li> </ul> <p><code>https://graph.facebook.com/oauth/access_token?client_id={app_id}&amp;redirect_uri={my_url}&amp;client_secret={app_secret}&amp;code={code}</code></p> <p>app_secret is your application secret key code is the code from step 1</p> <p>You will get as output the user access token. This one is a short live one.</p> <ul> <li>convert the short live to a long live user access token using:</li> </ul> <p><code>https://graph.facebook.com/oauth/access_token?grant_type=fb_exchange_token&amp;client_id={app_id}&amp;client_secret={app_secret}&amp;fb_exchange_token={short live access token}</code></p> <p>Replace the "short live access token" by the one you got on step 2 You will get as output the infinite user access token.</p> <ul> <li>Get the page access token (this one will be infinite access token as the user access token is now an infinite access token too):</li> </ul> <p><code>https://graph.facebook.com/me/accounts?access_token={infinite user access token}</code></p> <p>Replace the "infinite user access token" with the value you got on step 3.</p> <p>This command will list all the pages you administer. The output contains the page access token you need in field "access_token". You can so use this token in any API command in your application.</p> <p>The best of the best is to do all those steps via a server side program (PHP for me) as the application secret key should remain "secret".</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload