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

Posted

技术标签:

【中文标题】如何将对象发布到 facebook 用户墙?【英文标题】:how to post object to facebook user wall? 【发布时间】:2014-02-27 08:52:14 【问题描述】:

我正在使用 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】:

我猜你在这里使用的端点 URL 不完整

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

您应该调用 /me/feed 并发送帖子请求,如下所述:https://developers.facebook.com/docs/graph-api/reference/user/feed/#publish

【讨论】:

以上是关于如何将对象发布到 facebook 用户墙?的主要内容,如果未能解决你的问题,请参考以下文章