Is it possible to get a Facebook user's name from their Facebook Id number with a graph call? If so, does anyone know the call?
For example you can get a user's picture by making the following call
"http://graph.facebook.com/" + someUserId + "/picture"
Something like:
String response = facebook.request(userId);
JSONObject json = Util.parseJson(response);
String name = json.getString("name");
String username = json.getString("username");
Simply querying the Graph API with the user_id should be enough to get the name of the user -
http://graph.facebook.com/4
>>
{
"id": "4",
"name": "Mark Zuckerberg",
"first_name": "Mark",
"last_name": "Zuckerberg",
"link": "https://www.facebook.com/zuck",
"username": "zuck",
"gender": "male",
"locale": "en_US",
"updated_time": "2012-05-20T01:29:18+0000",
"type": "user"
}
You could drill down even more by adding a filter for the name field -
https://graph.facebook.com/4?fields=name
>>
{
"name": "Mark Zuckerberg",
"id": "4",
"type": "user"
}
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