如何将对象发布到Facebook用户墙?

时间:2014-02-27 08:52:14

标签: javascript facebook facebook-graph-api

我正在使用Facebook JavaScript SDK,此代码用于登录并将对象发布到用户的墙上,这会返回错误,

{"error":{"message":"(#200) You do not have sufficient to permissions to perform this action","type":"OAuthException","code":200}}

FB.login(function(data){ if(data.authResponse){ facebookGetDetails(); }else{
console.log("Login operation aborted"); } },{scope: 'email,publish_actions,read_stream'});

FB.api( '/me', 'post', { app_id: xxxxxxxxxxxx, type: "business.business", url: url, title: title, image: picUrl, contact_data: "Bangalore, India", location: "17.024522", description: desc }, function(response) { console.log(JSON.stringify(response)); // handle the response });

以下代码有效,但它只发布到活动流,而不是发布到墙。

FB.api( 'me/namespace:review', 'post', { business: "http://samples.ogp.me/616004095080596" }, function(response) { // handle the response } );

1 个答案:

答案 0 :(得分:0)

我猜你在这里使用的是不完整的端点网址

FB.api(
    '/me',
    ...
);

您应该根据此处所述的帖子请求致电 / me / feed https://developers.facebook.com/docs/graph-api/reference/user/feed/#publish