我想通過facebook圖表api(graph.facebook.com/me?access_token=token
)在node.js中獲取我的facebook帳戶詳細信息,但我無法使用它:Node.js - 獲取我的facebook帳戶詳細信息圖表api
access_token
= appid
+ '|'
+ appsecret
這裏是我的代碼:
var https=require('https');
var access_token = process.argv.slice(2)[0] + '|' + process.argv.slice(2)[1];
var options = {
host: 'graph.facebook.com',
path: '/me?access_token=' + access_token
};
https.get(options,function(res){
var data = '';
res.on('data', function (chunk) {
data += chunk;
});
res.on('end', function() {
console.log(data);
});
});
而我得到的錯誤:
{"error":{"message":"An active access token must be used to query information about the current user.","type":"OAuthException","code":2500}}
讓我知道了'|'中'js'但運營商如果像這樣使用這個令牌是永久的嗎?它不工作,反正給我這個錯誤:'{「錯誤」:{「消息」:「無效的OAuth訪問令牌。」,「類型」:「OAuthException」,「代碼」:190}} – h4k1m
給我鏈接記錄,以及你如何將params傳遞給節點? – damphat
[stackoverflow - 嘗試獲取應用程序訪問令牌](http://stackoverflow.com/questions/12948809/trying-to-get-app-access-token) – h4k1m