Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>After many days of pulling my hair out over this one I have seemed to have solved this issue. I will explain:</p> <p>The reason that my posts were coming from myself instead of the page is because the access_token I was using was from my account instead of from the page. You will need to get an access token from the page itself.</p> <p>Which is explained here (http://developers.facebook.com/docs/api#auth) under 'Page impersonation'</p> <p>This is how I did it.</p> <p>I firstly gave my account permission to manage the pages I had by using this url:</p> <pre><code>https://graph.facebook.com/oauth/authorize?client_id=...&amp;redirect_uri=...&amp;scope=manage_pages </code></pre> <p>you will need to insert client_id with your app id and insert a redirect url - You'll be brought to a page witch will ask you to authorise (which you should say yes to :)</p> <p>then in php I accessed details of my current account and the pages I administer with the following code:</p> <pre><code>require_once 'facebook-php-sdk/src/facebook.php'; $facebook = new Facebook(array( 'appId' =&gt; '...', 'secret' =&gt; '...' )); $attachment2 = array( 'access_token' =&gt; "..." //this is my current user access_token ); $page = $facebook-&gt;api('/me/accounts', 'get', $attachment2); print_r($page); </code></pre> <p>This will print out details about the pages you administer and access_tokens for those pages (bingo!)</p> <p>you can then take that/those access_token(s) and insert it in the code that I published above and whala - it will post to your page from your page. :)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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