2
Hi, guys. How to get a facebook user id, and its name using Graph api?
I can only get the message id using sender = event.sender.id;
function fbGetProfile(id) {
request({
method: 'GET',
uri: 'https://graph.facebook.com/v2.6/${id}',
qs: {
fields: 'first_name',
access_token:PAGE_ACCESS_TOKEN
},
json: true
}, function(error, response, body) {
if (error) {
console.log('Error sending message: ', error);
} else if (response.body.error) {
console.log('Error: ', response.body.error);
}
});