简体   繁体   English

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

[英]how to post object to facebook user wall?

I am using Facebook JavaScript SDK, this code is for log in and post an object to user's wall, which returns an error, 我正在使用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 });

the following code works, but it only posts to activity stream, not to wall. 以下代码有效,但仅发布到活动流,而不发布到墙。

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

I guess you're using a incomplete endpoint URL here 我想您在这里使用的端点URL不完整

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

You should call /me/feed with a post request as described here: https://developers.facebook.com/docs/graph-api/reference/user/feed/#publish 您应该使用以下所述的发帖请求致电/ me / feedhttps : //developers.facebook.com/docs/graph-api/reference/user/feed/#publish

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM