Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to get user access token dynamically for PAGE (no application)
    primarykey
    data
    text
    <p>I am trying to get the number of likes my PAGE has at various times in the past using the FQL Insights API. To do this, I need a page access_token. The get a page access_token I need a user access_token. However, the only way I know how to get a user access token is to go here: <a href="https://developers.facebook.com/tools/explorer" rel="nofollow">https://developers.facebook.com/tools/explorer</a> and click "Get Access Token" and then copy and paste.</p> <p>I can then get the PAGE access_token by running the following request: <a href="https://graph.facebook.com/PAGE_ID?fields=access_token&amp;access_token=USER_ACCESS_TOKEN" rel="nofollow">https://graph.facebook.com/PAGE_ID?fields=access_token&amp;access_token=USER_ACCESS_TOKEN</a></p> <p>And then I can get the number of likes using the following request: <a href="https://graph.facebook.com/fql?access_token=PAGE_ACCESS_TOKEN&amp;q=SELECT" rel="nofollow">https://graph.facebook.com/fql?access_token=PAGE_ACCESS_TOKEN&amp;q=SELECT</a> metric, value FROM insights WHERE object_id=PAGE_ID AND metric='page_fans' AND end_time=end_time_date('2013-05-15') AND period=period('lifetime')</p> <p>So I can do everything dynamically and automatically EXCEPT getting my user access token. That's my big problem. The user access token that I get manually will expire and then I will have to get another one for my script to work. How can I get my user access token dynamically with PHP? My user account has the necessary permissions on the page, if it's of any consequence.</p> <p>Thanks for any help you can give.</p>
    singulars
    1. This table or related slice is empty.
    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. 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