Node.js - Get my account details from facebook graph api

Viewed 6981

I'm trying to get my facebook account details in node.js via facebook graph api (graph.facebook.com/me?access_token=token), but I can't get it to work with:

access_token = appid + '|' + appsecret

Here is my code:

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);
    });
});

And the error I'm getting:

{"error":{"message":"An active access token must be used to query information about the current user.","type":"OAuthException","code":2500}}

2 Answers
Related