0

I'm trying to simply post to a facebook page as the page.

I created an app, set permissions ( manage_pages ), and requested an app token ( via https://developers.facebook.com/docs/facebook-login/access-tokens/ ).

I think I'm almost there but I'm getting an "PHP Fatal error: Uncaught OAuthException: (#200) The user hasn't authorized the application to perform this action" error.

<?php
require_once('facebook.php');
$config = array();
$config['appId'] = 'xxxxxxxxxxxxx';
$config['secret'] = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
$config['fileUpload'] = false; // optional
$facebook = new facebook($config);

$access_token = "app token I got from link above";
$facebook->setAccessToken($access_token);

$page_id = "xxxxxxxxxxxxxxxx";
$args = array(
        'access_token'  => $access_token,
        'message'       => "This is just a test.",
        'name' => "Just a test.",
        'link' => "http://www.xxxx.com/",
        'picture' => "http://www.xxxx.com/Logo.jpg",
        'actions' => array(
        'name' => 'See Pic',
        'link' => "http://www.xxxx.com/Logo.jpg"
        )

    );
   $post = $facebook->api("/$page_id/feed","post",$args);

Where am I missing to give auth so I can post to the page? I've been over the settings under my app dashboard and don't see that I'm missing anything.

Thanks

4

0 回答 0