How come I can't publish this to my user's Facebook wall?
I got the access_token (with email, publish_stream, and offline_access permissions).
Then, I do this code:
var uri = 'https://graph.facebook.com/' + req.user.fb.id + '/feed';
request({ 'method':'POST',
'uri':uri,
开发者_高级运维'json':{
'access_token':req.user.fb.accessToken,
'message':'testing 123',
},
},
function(err,response,body){
console.log(err);
console.log(body);
});
But facebook gives me this error message:
{"error":{"type":"OAuthException","message":"(#200) This API call requires a valid app_id."}}
I don't get it? The user logged in perfectly fine using facebook connect, and I got the access token.
You would need to send the access_token as part of the query string, not as the post body.
var uri = 'https://graph.facebook.com/' + req.user.fb.id + '/feed?access_token=' + req.user.fb.accessToken;
精彩评论