How to receive Facebook username? Graph API
Hi, guys. How to get a facebook user's id, and their name using Graph api?
I can only get the id of the messages, 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);
}
});
2
1 answers
The Graph API no longer allows to search for the username. I've also just checked the documentation and there's nothing there about it.
I saw that Facebook HTML contains two meta tags with User_ID:
<!-- Na URL https://www.facebook.com/zuck -->
<meta property="al:android:url" content="fb://profile/4" />
<meta property="al:ios:url" content="fb://profile/4" />
0
Author: brasofilo, 2017-05-23 12:37:30