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 8079641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:10:17+00:00 2026-06-05T16:10:17+00:00

I need someone help. When I open https://developers.facebook.com/docs/reference/api/ and clicked https://graph.facebook.com/me/likes?access_token=blablabla , I got

  • 0

I need someone help.

When I open https://developers.facebook.com/docs/reference/api/ and clicked https://graph.facebook.com/me/likes?access_token=blablabla, I got all page that I’ve liked.

My questions was, from where I got the access_token value? can I get it by script?

  • 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-05T16:10:19+00:00Added an answer on June 5, 2026 at 4:10 pm

    Facebook developer site leverages an internal test console application that all developers can use to test calls within the documentation, site automatically appends the access_token.

    A next place one can find the access token is https://developers.facebook.com/tools/explorer with the Graph API Explorer app.

    You can also get it via script by following one of the authentication flows described at http://developers.facebook.com/docs/authentication/

    You will need to create an application at https://developers.facebook.com/apps then,

    For example via PHP using a server side flow,

    • Redirect the user to the OAuth Dialog ($dialog_url shown below)
    • A code will be given in response
    • Exchange the code for a user access token ($token_url shown below)
    <?php 
    
       $app_id = "YOUR_APP_ID";
       $app_secret = "YOUR_APP_SECRET";
       $my_url = "YOUR_URL";
    
       session_start();
       $code = $_REQUEST["code"];
    
       if(empty($code)) {
         $_SESSION['state'] = md5(uniqid(rand(), TRUE)); //CSRF protection
         $dialog_url = "http://www.facebook.com/dialog/oauth?client_id=" 
           . $app_id . "&redirect_uri=" . urlencode($my_url) . "&state="
           . $_SESSION['state'];
    
         echo("<script> top.location.href='" . $dialog_url . "'</script>");
       }
    
       if($_SESSION['state'] && ($_SESSION['state'] === $_REQUEST['state'])) {
         $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/likes?access_token=" 
           . $params['access_token'];
    
         $likes = json_decode(file_get_contents($graph_url));
         print_r($likes); // A dump of the likes data
       }
       else {
         echo("The state does not match. You may be a victim of CSRF.");
       }
    
     ?>
    

    See more of the reference information available at http://developers.facebook.com/docs/authentication/server-side/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

can someone help with this? I need the following function to do this... $x
I hope someone can help me. I need to notify user after he successfully
I need to do a non greedy match and hope someone can help me.
I am stuck and in need of a hand. Hope someone can help? Anyone
I'm retrieving image from DB using Stream. Need someone to help me to convert
I need someone to help point out the obvious to me...been looking for hours
I'm new here and I'm very stuck. I need help. Hopefully someone can tell
I need some help with a very simple applescript. I need it to open
I need someone to back me up, or prove me wrong, in regard to
I need someone to explain the following names; Asynchronous Delegates. Asynchronous methods. Asynchronous events.

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.