title: facebook php sdk - Error #200 when trying to use setExtendedAccessToken
body: <p>I have been trying for several days now to successfully post to a client's Facebook Page wall from their website. I need to be able to do this without having a user logged in, which I was able to achieve with an extended access token generated by going to the URL provided in the docs.</p>
  
  <p>What I am trying to do is to fetch an extended token using the PHP SDK as in this question - <a href="https://stackoverflow.com/questions/10903991/facebook-php-sdk-getting-long-lived-access-token-now-that-offline-access-is">Facebook PHP SDK: getting &quot;long-lived&quot; access token now that &quot;offline_access&quot; is deprecated</a>, however I receive the following error:
  <code>(#200) The user hasn't authorized the application to perform this action</code></p>
  
  <p>The debug of the auth token generated by the Graph API Explorer shows myself as the User and includes the needed <code>manage_pages</code> and <code>status_update</code> scopes. However, if I run <code>me/accounts</code>, the <code>perms</code> array does not list these under the data for the page in question - not sure if this is relevant.</p>
  
  <p>Here is the code that I have attempted to use:</p>
  
  <pre><code>$facebook = new Facebook(array('appId' =&gt; 'xxxxxxx', 'secret' =&gt; 'xxxxxx'));
      $pageID = 'xxxxxxxx';
      $facebook-&gt;setExtendedAccessToken();
      $accessToken = $facebook-&gt;getAccessToken();
      try {
          $page_info = $facebook-&gt;api("/$pageID?fields=access_token");
          print_r ($page_info);
      } catch (FacebookApiException $e) {
              echo $e-&gt;getMessage();
      }
      if( !empty($accessToken) ) {
          $args = array(
              'access_token'  =&gt; $accessToken,
              'message'       =&gt; "Catch phrase!"
          );
          $facebook-&gt;api("/$pageID/feed","post",$args);
      } else {
          // Handle error
      }
  </code></pre>
  
  <p><strong>UPDATE</strong>
  I found that if I echoed the output of <code>getAccessToken()</code> the result was the app ID and the secret separated by an <code>|</code> - is this what I should be receiving? Seems odd to me since all of the other tokens I have seen are random and much longer.</p>
  
  <p>ANY help at all would be appreciated, I have wasted so much time on this so far. It just seems to work for everyone else.</p>
  
  <p><strong>UPDATE 2</strong>
  Hi Warren! Looks like you're new around these parts, welcome! Thanks for your research into this, do I need to save these tokens into a DB table and check to see if they are expired every time I try to post? I am ONLY posting to a Page as the Page, apparently this requires the Page <code>access_token</code> rather than what I am assuming is the USER <code>access_token</code>. I believe I also read somewhere that the Page access token never expires, although it changes if I refresh the Graph API Explorer page or request a new user token. Very puzzling.. do not know if I even need to deal with getting new tokens in this app or just use a Page <code>access_token</code> that appears to work?</p>