i am trying to post into a Facebook Page using PHP.
I have created a Facebook application, and
I am able to post into regular accounts FEED, using the very helpful code i found out in : Daily Automatic post in facebook users wall .
to summarize it does:
$facebook = new Facebook(array('appId' => 'xxxxxxxx',
'secret' => 'xxxxxxxxxxxxxx',));
$post = array('message' => 'Message to user');
$post_id = $facebook->api("/$USER_ID/feed", "post", $post);
There is no need in any access_token what so ever.
i have granted my application with the following permissions from the PAGE (and from the regular account) : publish_stream,manage_pages
But… this doesn’t seem to work with Facebook PAGE.
i do not seem to be able to post to it from my app.
i have tried the following, and other combinations, but Facebook doesn’t return any error message, nor doesn’t posts:
$feed = '/MYPAGEID/feed';
$post_id = $facebook->api($feed, "post", $post);
Your help is very much appreciated!
In the documentation for the Page object it says:
and
Also, be sure to check the Authenticating as a Page tutorial.