Note that there are some explanatory texts on larger screens.

plurals
  1. POFacebook App Uncaught OAuthException: An active access token must be used to query information about the current user. thrown
    text
    copied!<p>Hello I am trying to post to the wall of a user but the following error occurs: Uncaught OAuthException: An active access token must be used to query information about the current user. thrown ....</p> <p>My facebook script is:</p> <pre><code>$appId = 'xxxxxx'; //change as necessary $appUrl = "xxxxx"; //change as necessary $baseUrl = "xxxxx/"; //change as necessary // Create our Application instance. $facebook = new Facebook(array( 'appId' =&gt; $appId, 'secret' =&gt; 'xxxxxx', //change as necessary 'cookie' =&gt; true, )); $session = $facebook-&gt;getSession(); $fbme = null; // Session based graph API call. if (!$session) { $login_url = $facebook-&gt;getLoginUrl ( array ( "canvas" =&gt; true, "fbconnect" =&gt; false, "req_perms" =&gt; "user_location, email, publish_stream, friends_about_me, offline_access,", ) ); echo "&lt;script type='text/javascript'&gt;top.location.href = '" . $login_url. "';&lt;/script&gt;"; } $session = $facebook-&gt;getSession(); $me = null; // Session based API call. if ($session) { try { $uid = $facebook-&gt;getUser(); $me = $facebook-&gt;api('/me'); $mail=$me[email]; } catch (FacebookApiException $e) { error_log($e); } } $signed_request = $_REQUEST["signed_request"]; list($encoded_sig, $payload) = explode('.', $signed_request, 2); $data = json_decode(base64_decode(strtr($payload, '-_', '+/')), true); $token=$data[oauth_token]; $attachment = array('message' =&gt; '', 'access_token' =&gt;$token, 'name' =&gt; '', 'caption' =&gt; "", 'link' =&gt; '', 'description' =&gt; '', 'picture' =&gt; '', 'actions' =&gt; array(array('name' =&gt; 'Get Social', 'link' =&gt; '')) ); $result = $facebook-&gt;api('me/feed','post',$attachment); </code></pre> <p>How can i obtain users access token?</p>
 

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