Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8293145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:43:51+00:00 2026-06-08T13:43:51+00:00

So here’s the deal, I’m learning how to work with facebook api, and I’m

  • 0

So here’s the deal, I’m learning how to work with facebook api, and I’m having some difficulties trying to understand it, the documentation isn’t at all organized imho.

So I’m getting this error “Impersonated access tokens can only be used with the Graph API”

And I think it’s because I copied the token from the graph API explorer.

My main purpose with this project is to have a normal website, that fetches some data of my facebook page(albums, photos and events) and display it on the website as page content. It’s like the facebook page is the backoffice.

How can I solve this?

Here’s a real example, of what I’m trying to accomplish:
http://codecanyon.net/item/facebook-album-gallery/full_screen_preview/400462

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T13:43:52+00:00Added an answer on June 8, 2026 at 1:43 pm

    I agree that FB documentation is to be nice…”unorganized”.

    Regardless there are a few steps required to get the access tokens.. copying from FB explorer wont work.

    1. Register an FB app
    2. Use the FB app ID and secret key to create a .php page (for example) to get a user to give you specifically requested permissions
    3. When the user completes the request for permissions, FB will redirect the user to your specified callback and append an access_token to the URL
    4. parse that token, and store it somewhere
    5. use that access_token to get the data off the API that you want
    6. If the access_token is permanent then you can use the stored token for later to get more data offline.

    I modified the example code as follows to create the apps permissions grabbers:

    $app_id = "myappid";
    $app_secret = "mysecret";
    $my_url = "http://mycallbackurl";
    session_start();
    $code = $_REQUEST["code"];
    (empty($code)) {
     $_SESSION['state'] = md5(uniqid(rand(), TRUE)); //CSRF protection
     $dialog_url = "https://www.facebook.com/dialog/oauth?client_id="
       . $app_id . "&redirect_uri=" . $my_url 
       . "&scope=offline_access,manage_pages,read_stream,read_insights,export_stream,read_friendlists";
    
      }else{
    
      $token_url = "https://graph.facebook.com/oauth/access_token?"
       . "client_id=" . $app_id . "&redirect_uri=" . urlencode($my_url)
       . "&client_secret=" . $app_secret . "&code=" . $code;
    
      $response = file_get_contents($token_url);
      $params = null;
      parse_str($response, $params);
    
      $graph_url = "https://graph.facebook.com/me?access_token="
       . $params['access_token'];
    
     $user = json_decode(file_get_contents($graph_url));
     $at = $params['access_token'];
     $uid = $user->id;
     $un = $user->name;
    
     ...and so on
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is the code in a function I'm trying to revise. This example works
Here is my work environment: Eclipse Juno as IDE with maven2 plugin on it
Here's what I'm trying to accomplish with this program: a recursive method that checks
Here is the css: #content ul { font-size: 12px; } I am trying this:
Here is the problem that I am trying to solve. I have two folders
Here is my program to find all the subsets of given set. To solve
here i want to understand the architecture of bluez (Bluetooth Stack Protocol). I understood
Here's the flow that I am trying to achieve: 1) User uploads an audio
Here is what I am trying to achieve in PHP: I have this string:
Here's what I'm trying to do... It's quite simple and obviously there must be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.