How to receive facebook username? Graph API

2

Hi everyone. How to get the id of a facebook user, 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);
    }
  });
    
asked by anonymous 07.05.2016 / 02:14

1 answer

0

The Graph API no longer searches by username. I also just checked the documentation and have nothing there.

I saw that the Facebook HTML contains two meta tags with the 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" />

    
18.05.2017 / 00:23