Posting an Open Graph action using the Node.js facebook-node-sdk
module gives me {"error": "An active access token must be used to query information about the current user."}
.
var FB = require( 'fb' )
var path = '/me?' + namespace + ':' + action_type_name
var body = {
access_token: myAccessToken,
myAction : myCustomObjectURL
}
FB.api( path, 'post', body, function( res )
{
if( res.error ) {
console.log( 'the call to open graph failed: ' + res.error.message );
}
else {
console.log( 'success' )
}
})
If I print this access token and use it with cURL (curl https://graph.facebook.com/me?access_token=myAccessToken
), it returns correctly, no error. Facebook also shows that the app has permission to post as this user. So what am I doing wrong here?