I am looking for a solution which can provide me user id from profile url or fb username
example :http://facebook.com/username
get userid of this url
and also when I try to read friends (I have friend related permission), I am getting blank data array ex:
graph api requ: https://graph.facebook.com/v2.1/me/friends?access_token=xxxxx
response:
{
"data": [
],
"summary": {
"total_count": 455
}
}
Please let me know how can I get friend list and userid using username in Facebook graph api v2.1
The Graph API is the primary way to get data into and out of the Facebook platform. It's an HTTP-based API that apps can use to programmatically query data, post new stories, manage ads, upload photos, and perform a wide variety of other tasks.
Finding Contact Information on FacebookEnter a person's name in the search field, and the results identify users with that name or with a closely related name. Scan the results for the person you're seeking. If you are unsuccessful, try some name variations, like William instead of Billy, or Elizabeth for Betsy.
User ID. Your User ID is a string of numbers that doesn't personally identify you but does connect to your Facebook profile. You have a User ID automatically, whether or not you choose to create a username.
Hi dhiraj you can get all of your friends username, user id and their profile picture by doing this....https://graph.facebook.com/v2.1/me/taggable_friends?access_token=xxxxx....Hope this helps...and please dont forget to upvote if you identify this as an answer
https://graph.facebook.com/v2.1/me/friends?access_token=xxxxx would return the friends who are using your app i.e., who have authenticated your app...where as https://graph.facebook.com/v2.1/me/taggable_friends?access_token=xxxxx will return all of your friends
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