I was using Facebook's graph api, asking for '/me', and it only returns the name and Id of the user. I know that it logs in properly, because it returns the correct name.
Here is a snippet of the javascript code I was using:
FB.login(function (response) {
// handle the response
FB.api('/me', function (usrresponse) {
document.getElementById('inFbStatus').innerHTML = 'Successful login to Facebook';
console.log(JSON.stringify(usrresponse));
});
}, { scope: 'email, basic_info' });
The simplest way to get a copy of the User Profile object is to access the /me endpoint: FB. api('/me', function(response) { }); This will this will return the users name and an ID by default.
Open the Graph Explorer in a new browser window. This allows you to execute the examples as you read this tutorial. The explorer loads with a default query with the GET method, the lastest version of the Graph API, the /me node and the id and name fields in the Query String Field, and your Facebook App.
Applies to all versions. Facebook Analytics will no longer be available after June 30, 2021. Additionally, we are deprecating the App Dashboard Plugin for Marketing API. For more information visit the Business Help Center.
The Graph API is named after the idea of a "social graph" — a representation of the information on Facebook. It's composed of nodes, edges, and fields.
You have to specify each field and edge you want to get returned, e. g.
/me?fields=id,name,email
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With