title: How to work with Facebook App Access Tokens?
body: <p>I've been reading a lot in the last few days, and I'm sure that I've been learning a lot. All this due Facebook documentation being spread (in the bad sense) all over the web, making people looking for the information and trying a lot of things.</p>
  
  <p>I've done some stuff like:</p>
  
  <ul>
  <li>Posting to pages' wall (images, links, text)</li>
  <li>Posting to profiles' wall</li>
  </ul>
  
  <p>So, I've thought about creating a kind of an automatic poster to pages. But, imagine what. We need Access Tokens to that, those that won't expire.</p>
  
  <p>Ok, no problem. From what I've been reading App Access Tokens take care of that, and then I can run a cron with the script!</p>
  
  <p>But how it is supposed to run the posting with the Access Token?</p>
  
  <p>Currently, with the user token, I was using this code if the id of the logged in user could be retrieved.</p>
  
  <pre><code>FB.api('/&lt;?=$album_id?&gt;/photos?access_token=&lt;?=$fanpage_token?&gt;', 'post', {
      message: ementa,
      url: selected_image
      }, function(response) {
    if (!response || response.error) {
      alert('Falhou a publicar a ementa com imagem');
    } else {
      alert('Page Post ID: ' + response.id);
    }
  });
  </code></pre>
  
  <p>I've got the fan page token manually from the Graph API Explorer, because this is just going to be used by the cronjob.</p>
  
  <p>Album ID i've got previously too.</p>
  
  <p>How could I use this with an App Token?</p>
  
  <p>Thanks!</p>