Post to Facebook Page Wall

做~自己de王妃 提交于 2019-12-04 23:08:59
$facebook->api('/123456789/feed', 'post', array(
    'access_token' => $token,
    'link' => 'http://www.example.com'
));

Note the 'post' part.

If you look at the source for the API via the link you provided, you'll see:

protected function _graph($path, $method='GET', $params=array()) {
    if (is_array($method) && empty($params)) {
      $params = $method;
      $method = 'GET';
    }

When you don't have 'post' as the second argument and your array as the third, it goes a get

If you are getting authorisation errors, make sure you have included the following permission:

 publish_stream

https://developers.facebook.com/docs/reference/api/post/

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!