Vaishnavesh
Vaishnavesh

Reputation: 154

Facebook API : Can I get user's public URL in v2

In v1 we can get user public link

/v1.0/me

function testAPI() {
    console.log('Welcome!  Fetching your information.... ');
    FB.api('/me', function(response) {
      console.log('Successful login for: ' + response.link);
      document.getElementById('status').innerHTML = response.link';
    });
  }

result will be https://www.facebook.com/user_id

but in v2

/v2.0/me

function testAPI() {
    console.log('Welcome!  Fetching your information.... ');
    FB.api('/me', function(response) {
      console.log('Successful login for: ' + response.link);
      document.getElementById('status').innerHTML = response.link';
    });
  }

result will be https://www.facebook.com/app_scoped_user_id/814241178599786/

Is that possible to get public URL from Facebook API? If yes then how?

Thank You

Upvotes: 0

Views: 885

Answers (1)

Chris Houghton
Chris Houghton

Reputation: 707

In Graph v2.0, this is not possible. The reason for this is that Facebook are trying to provide users with more data security.

As you mentioned, the app scoped user URL https://www.facebook.com/app_scoped_user_id/814241178599786/ will redirect to their profile page.

Also note that you can't get:

  • The user's actual Facebook ID
  • The user's username

Upvotes: 2

Related Questions