title: Publish from an Application to a Page (to a User Wall)
body: <p><strong>What I want to do:</strong></p>
  
  <p>Publish a post on a Facebook page each time new content is added to the website, whether or not I am logged in to Facebook.</p>
  
  <p><strong>What works now:</strong></p>
  
  <p>Publishing a post on my own wall.</p>
  
  <p><strong>What I have done to achieve this:</strong></p>
  
  <ol>
  <li>I've created an App </li>
  <li>I've given the app the permissions needed<br>
  following http://www.facebook.com/login.php?api_key=[my appId]   &amp;next=http://www.facebook.com/connect/login_success.html&amp;req_perms=read_stream,publish_stream,manage_pages,publish_actions</li>
  <li><p>next, I've created a script to post content, basically this is it:</p>
  
  <pre><code>$appId='12822*****98');
  $secret='17c*****************320f');
  
  // on récupére l'instance de classe Facebook
  $facebook=new Facebook(array(
     'appId'  =&gt; $appId,
     'secret' =&gt; $secret
  ));
  
  // acquisition du token
  $url='https://graph.facebook.com/oauth/access_token?'.
      'client_id='.$appId.
      '&amp;client_secret='.$secret.
      '&amp;grant_type=client_credentials'.           '&amp;scope=read_stream,publish_stream,publish_actions,manage_pages,offline_access'.
    '&amp;state=dfgdfgdtgdgfdfg';
  $reponse = file_get_contents($url); 
  $tabReponse=explode('=',$reponse);
  $accessToken=$tabReponse[1];
  $facebook-&gt;setAccessToken($accessToken);
  
  $params = array(
      'message' =&gt; 'the message',
      'link' =&gt; 'http://www.myAppUrl.com'),
      'name'    =&gt; 'the name',
      'description' =&gt; 'some description',
  );
  
  try {                           
  // la cible
  $targetID='1471*********81';
  
  // publication
  $publishStream = $facebook-&gt;api("/$targetID/feed/", 'POST',     $params);           
  
  } catch (FacebookApiException $e) {
      $result = $e-&gt;getResult();
      print("Attention, la publication FB a échoué, veuillez vérifier les paramètres!");
  }
  </code></pre></li>
  </ol>
  
  <p>If I print the access token delivered on the first step, I get something like <code>{appId}|***************************</code> (27 caracters), which I've read on <a href="http://benbiddington.wordpress.com/2010/04/23/facebook-graph-api-getting-access-tokens/" rel="nofollow">this old post</a> is a valid token for some operations but not all.<br>
  With this, I can publish on my personal wall, but not on a page I admin, in this last case, I get a <code>#200 error</code> (about user that has not authorized the app to do this action).</p>
  
  <p>If I use the Graph API Explorer to generate an access token for my app, I get a long string representing the access token, and if I use it in the <code>setAccessToken</code> invoke, the I can quite publish on the page. Since I get a <code>#100 error</code> (about links that must refer to Canvas URL, even if "Stream post URL security:" is set Off on the app settings)</p>
  
  <p><strong>Does someone know how to achieve what I want?</strong></p>
  
  <p>I don't want any USER connection, it is the server who must request credentials to post through the app, not a user.</p>