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

  • SEARCH
  • Home
  • 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 7736829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T07:50:36+00:00 2026-06-01T07:50:36+00:00

Solution Edit: Turns out you can’t use the PHP SDK to return the correct

  • 0

Solution Edit:
Turns out you can’t use the PHP SDK to return the correct App Token, nor can you hit the OpenGraph options in the App section of the Developer site, click “Get Code” and grab the app access token from there.. you have to do this:

$token_url = 'https://graph.facebook.com/oauth/access_token?client_id=' . $fbConfig['appId'] . '&client_secret=' . $fbConfig['appSecret'] . '&grant_type=client_credentials';
$accessToken = explode('=',file_get_contents($token_url));
$accessToken = $accessToken[1];

Original issue:
Using the PHP SDK, I’ve been trying unsuccessfully in registering my achievements. I keep getting the following error:
“This method must be called with an app access_token.”

However, when I enter the token I’m using into opengraph (https://graph.facebook.com/app?access_token=ACCESS_TOKEN) I get my app information correctly.

Here are the methods I’ve tried thus far in registering my achievements:

$param = array(
    'access_token' => $accessToken,
    'achievement' => 'http://domain.com/path/to/my/achievement/page',
    'display_order' => $achievements['achievementWeight']
);
$achievement = $fb->api('/'.$this->CI->config->item('app_id').'/achievements', 'POST', $param);

$superCurl = "curl -F 'achievement=" . $achieveUrl . "&access_token=" . $accessToken . "' https://graph.facebook.com/" . $appId . "/achievements";
exec($superCurl,$result);


$url = 'https://graph.facebook.com/' . $this->CI->config->item('app_id') . '/achievements?access_token=' . $accessToken;
$c = curl_init ($url);
curl_setopt($c, CURLOPT_HEADER, false);
curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($c, CURLOPT_POST, true);
curl_setopt($c, CURLOPT_POSTFIELDS, $param);
curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
if(curl_errno($c)){
    $this->CI->firephp->log(curl_error($c));
}
$page = curl_exec ($c);
curl_close ($c);

Everything always comes back saying it needs an access_token.

  • 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-01T07:50:37+00:00Added an answer on June 1, 2026 at 7:50 am

    See the Authenticating as an App document – you must use the app’s access token which allows you to act on behalf of the app – a user access token won’t suffice for this case (and several others)

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

Sidebar

Related Questions

Intro: EDIT: See solution at the bottom of this question (c++) I have a
[edit] Found the solution. Reinstall EVERYTHING - xcode, mono, monodevelop and monotouch. Now it
EDIT: This was formerly more explicitly titled: - Best solution to stop Kontiki's KHOST.EXE
My current solution will suck sometimes EDIT For those who don't understand,see this example:
Please note the Edit below for a lot more information, and a possible solution
EDIT: OK, I believe the following solutions are valid: Use the jQuery AOP plugin.
Solution to original problem (below) may have been discovered. I commented out <identity> ...
I still can't figure out how to make a subclass constructor follow its parent...
Maybe someone somewhere had the same issue and can help me out. I'm using
Can anybody offer a solution to the above? For now, all i want to

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.