Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>To publish as a page you need to get the user page admin token.... </p> <p>Abbreviated version of Page Authentication: (added offline_access) From <a href="http://developers.facebook.com/docs/authentication/" rel="nofollow">http://developers.facebook.com/docs/authentication/</a></p> <p>Get the token with manage premissions and offline_access: (update with YOUR_APP_ID and YOUR_URL</p> <pre><code>https://www.facebook.com/dialog/oauth?client_id=YOUR_APP_ID&amp;redirect_uri=YOUR_URL&amp;scope=manage_pages,offline_access&amp;response_type=token </code></pre> <p>Once you authenticate the page, you will be redirected to YOUR_URL... In the browser you will see the redirect url, a hash, the access token, expires... copy everything between the 'token=' and '&amp;expires=0' (if it doesnt have expires=0 you did not do offline access premissions)</p> <pre><code>&lt;?php require_once('facebook.php'); $app_id = "YOURAPPID"; $app_secret = "YOURSECRET"; $userAppToken = 'TOKENHERE!'; // from authentication $pageID = '123456'; $facebook = new Facebook(array( 'appId' =&gt; $app_id, 'secret' =&gt; $app_secret, 'cookie' =&gt; true )); $token = array( 'access_token' =&gt; $userAppToken ); // Get the user page admin tokens (account access info) $userdata = $facebook-&gt;api('/me/accounts', 'GET', $token); // Loop through the data and get the token for the page id.. foreach($userdata['data'] as $data) { if ($data['id'] == $pageID) { $pageAdminToken = $data['access_token']; continue; } } // THis is actually for a wall post, but just modify to whatever you want (you must have access_token as it is what authorizes the action for the page.. // compile the post $WallPost = array( 'message' =&gt; 'Test post from my app!', 'access_token' =&gt; $pageAdminToken ); // you can also use 'picture', 'link', 'name', 'caption', 'description', 'source'.... //http://developers.facebook.com/docs/reference/api/ // post to wall (feed is wall post, just update to whatever you want to publish to) $response = $fb-&gt;api($pageID . '/feed','GET',$WallPost); ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
 

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