我正试着代表应用程序在用户墙上发帖。
这就是我正在做的事情。
首先,我从facebook connect获取用户access_token,然后使用以下调用接收extended access token
https://graph.facebook.com/oauth/access_token?
client_id=APP_ID&
client_secret=APP_SECRET&
grant_type=fb_exchange_token&
fb_exchange_token=EXISTING_ACCESS_TOKEN 现在,当我尝试用下面的代码在朋友墙上发帖时。
var params = {};
params['message'] = 'Check out this new gag I\'ve posted about you surely it will piss you off :p';
params['name'] = 'Gagsterz';
params['description'] = 'If you also want to have fun on gagster join in now.';
params['link'] = 'http://localhost/php/backup/View/Profile.php';
params['picture'] = thumbpath;
params['caption'] = 'Caption';
FB.api('/'+victimid+'/feed?access_token="ACCESS_TOKEN", 'post', params, function(response) {
if (!response || response.error) {
var json = $.parseJSON(response.error);
alert(json.code);
alert(JSON.stringify(response.error));
} else {
alert('Published to stream - you might want to delete it now!');
}
});它会给出以下错误。
the target user has not authorized this action facebook graph api
with code 200.我获取了权限令牌,并对其进行了测试,方法是恢复权限,然后再次登录以授予权限,登录窗口要求输入post on behalf permission.But I permission.But Ipost on behalfpermission.But,而我第一次检索访问令牌时正在获取权限。对于扩展访问令牌,我必须重新获取权限吗?如果是,那该怎么做呢?
发布于 2012-12-03 22:07:19
检查您的权限,您是否有权限张贴在墙上。默认情况下,您将只具有读取权限。
检查此http://developers.facebook.com/docs/reference/rest/stream.publish/
https://stackoverflow.com/questions/13684860
复制相似问题