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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:16:57+00:00 2026-06-02T20:16:57+00:00

I am currently having issues with the 60 day access_token. I grab the fansite

  • 0

I am currently having issues with the 60 day access_token. I grab the fansite access_token thru /me/applications and I want to post on them, without the need for refreshing the site every 2 hours.

When I’m parsing the token for the fansite in the way facebook provides it just throws an error.

The login is handled thru Javascript and in the background with the PHP SDK.

Greetings,
Moritz

Edit:

{"error_code":1,"error_msg":"An unknown error occurred"} is the error.

Code is this:

$attachment = array('message' => $post['title'],
                        'link' => $unique,
                        'actions' => '{"name": "Fanseiten Admin?", "link": "http://google.com"}',
                        'access_token' => $page['access_token']);
$result = $facebook->api('/'.$page['pageid'].'/feed', 'post', $attachment);

Simply pushes to a site with the access token stored in a database.

  • 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-02T20:16:59+00:00Added an answer on June 2, 2026 at 8:16 pm

    I found the solution: extend the base_facebook.php class with following and call

    $facebook->setAccessToken($facebook->getExtendedAccessToken());
    

    The access_token for apps also now extends to 60 days.

    public function getExtendedAccessToken(){
    
        try {
            // need to circumvent json_decode by calling _oauthRequest
            // directly, since response isn't JSON format.
            $access_token_response =
                $this->_oauthRequest(
                    $this->getUrl('graph', '/oauth/access_token'), array(
                        'client_id' => $this->getAppId(),
                        'client_secret' => $this->getAppSecret(),
                        'grant_type'=>'fb_exchange_token',
                        'fb_exchange_token'=>$this->getAccessToken()
                    )
                );
        } catch (FacebookApiException $e) {
            // most likely that user very recently revoked authorization.
            // In any event, we don't have an access token, so say so.
            return false;
        }
    
        if (empty($access_token_response)) {
            return false;
        }
    
        $response_params = array();
        parse_str($access_token_response, $response_params);
        if (!isset($response_params['access_token'])) {
            return false;
        }
    
        return $response_params['access_token'];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently having issues redirecting both STDError and STDOutput. What I want to
Hello everyone I'm currently having 2 issues with the code below: Upon return of
I'm having issues getting the CSS3 box-shadow to look correct. I currently have a
I'm currently adding transposition tables in my chess engine, and I'm having issues with
I'm trying to learn C++ currently, but I'm having issues with the code below.
I am currently transitioning from VB to C# and am having some issues with
I am currently learning C, and am having some issues with trying to make
I am currently developing a site for a client (http://184.168.136.225/). Having some issues with
i'm currently having issues changing track information at the lock screen. I have managed
I'm currently having issues using the Vimeo framework on IE7. The first error I

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.