使用 Node.jsfacebook-node-sdk
模块发布 Open Graph 操作给了我{"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' )
}
})
如果我打印此访问令牌并将其与 cURL ( curl https://graph.facebook.com/me?access_token=myAccessToken
) 一起使用,它将正确返回,没有错误。Facebook 还显示该应用有权以该用户身份发帖。那么我在这里做错了什么?