发布到墙上的Facebook api错误

时间:2012-06-01 09:13:33

标签: facebook facebook-graph-api

$facebook->api('/me/feed', 'post', array(
    message => "Test" ,
    link => "link",
    name => "test",
    picture => "test pic",
    caption => "test",
    description => "test"
));

我得到的错误是 未捕获OAuthException:(#100)抱歉,此帖子包含已阻止的网址

当我在localhost上运行时出现错误,只有当我将代码上传到服务器然后运行它时才会出现

3 个答案:

答案 0 :(得分:0)

您是否在应用设置中启用了“Stream post URL security”迁移功能? 如果是,URL是否符合要求?

答案 1 :(得分:0)

  1. 用户是否已自动执行publish_stream权限
  2. 您是否在Fb dev界面中修改了应用程序,以便将服务器URL链接到应用程序而不是localhost?

答案 2 :(得分:0)

使用JS SDK https://developers.facebook.com/docs/reference/javascript/FB.api/

在使用OAUTH 进行身份验证之前 https://developers.facebook.com/blog/post/525/

var body = 'Reading JS SDK documentation';
FB.api('/me/feed', 'post', { message: body }, function(response) {
  if (!response || response.error) {
    alert('Error occured');
  } else {
    alert('Post ID: ' + response.id);
  }
});