[GET /v2.2/me HTTP/1.1]
A user represents a person on Facebook. The /{user-id} node returns a single user.
1. Go to https://developers.facebook.com/docs/graph-api/reference/v2.2/user
2. Click "Graph Explorer" -> "Get Access Token" -> "User Data Permissions" -> Select "user_about_me" -> Click "Get Access Token", you will see a access token look like "CAACEdEose ... ccKEs" show in the field, then click Submit.
3. You will see a JSON string which is an array of Friendlist objects, Ex:
{
"id": "1234123412341234",
"bio": "I love music!",
"first_name": "bear",
"gender": "male",
"last_name": "lin",
"link": "https://www.facebook.com/app_scoped_user_id/1234123412341234/",
"locale": "zh_TW",
"name": "bear lin",
"timezone": 8,
"updated_time": "2013-11-17T09:22:13+0000",
"verified": true
}
4. The more Access token you select, the more information will return.
[GET /v2.2/me/friendlists HTTP/1.1]
A person's 'friend lists' - these are groupings of friends such as "Acquaintances" or "Close Friends", or any others that may have been created
1. Go to https://developers.facebook.com/docs/graph-api/reference/v2.2/user/friendlists
2. Click "Graph Explorer" -> "Get Access Token" -> "Extended Permissions" -> Select "read_friendlists" -> Click "Get Access Token", you will see a access token look like "CAACEdEose ... ccKEs" show in the field, then click Submit.
3. You will see a JSON string which is an array of Friendlist objects, Ex:
{
"data": [
{
"id": "4777092484211",
"name": "Artists",
"list_type": "user_created"
},
{
"id": "4777064723517",
"name": "Musicians",
"list_type": "user_created"
}
],
"paging": {
"next": "https://graph.facebook.com/v2.2/1234123412341234/friendlists?limit=5000&offset=5000&__after_id=enc_AeyE7DuzMXSU9JFIGYuR1XfRcZT-U6YI205muBRRkOIAIAk_UhLZ3kMtWkS67_mgwuE"
}
}
[GET /v2.2/{friendlist-id} HTTP/1.1]
A friend list - an object which refers to a grouping of friends created by someone or generated automatically for someone (such as the "Close Friends" or "Acquaintances" lists)
1. Go to https://developers.facebook.com/docs/graph-api/reference/v2.2/friendlist
2. In the "Graph Explorer" you should replace "{friendlist-id}" with a valid Id(ex: 4777092484211, you can get it from /v2.2/me/friendlists).
3. After submit, Ex:
{
"id": "4777092484211",
"name": "Artists",
"list_type": "user_created"
}
Name | Description | Type |
id | The friend list ID | string |
name | The name of the friend list | string |
list_type | The type of the friend list | enum{close_friends, acquaintances, restricted, user_created, education, work, current_city, family} |
[GET /v2.2/me/friends HTTP/1.1]
A person's friends.
"
Friend list now only returns friends who also use your app".
Read below articles fist:
http://stackoverflow.com/questions/23417356/facebook-graph-api-v2-0-me-friends-returns-empty-or-only-friends-who-also-u
https://developers.facebook.com/docs/apps/changelog [Read API Version v2.0 changelog]
1. Go to https://developers.facebook.com/docs/graph-api/reference/v2.2/user/friends
2. In the "Graph Explorer":
Permissions
- A user access token with
user_friends
permission is required to view the current person's friends.
- This will only return any friends who have used (via Facebook Login) the app making the request.
- If a friend of the person declines the
user_friends
permission, that friend will not show up in the friend list for this person.
3. After submit: Ex:
{
"data": [
{
"name": "Eric",
"id": "33333333333333"
},
{
"name": "Lee",
"id": "111111111111"
}
],
"paging": {
"next": "https://graph.facebook.com/v2.2/1234123412341234/friends?limit=25&offset=25&__after_id=enc_AexidG6KKymgeEvLC38u6ERUDQud__sm2tYQkoPMs2ba6l8E17X73s-pSYx5y5hnuDdwFpyt23dt_Gi3GWiZ1raR"
},
"summary": {
"total_count": 307
}
}
4. You can also using Postman:
GET /v2.2/1234123412341234/friends?access_token=CAACEdEose0cBAIBIg6ZA9P9YNQQxLpmzT4VSBj2dYClv7vIM7aeXNoHpRTq27yGPh14szRVC2VVU6727V66BItbgUuco1tHVo6ZAwr2LhLlZCu3KxuHSuW6ZASBWm9T44RWWnHCbvFELTSJkveqArEAVEdPwkjHIyDFiAQJX6na9uESefCVfX0e4fUNvKjAkvK7b7BSKkhkCEKulWhPO HTTP/1.1
Host: graph.facebook.com
After API Version v2.0, "/me/friends" no longer return full friends list, it only returns the user's friends who are also using your app, please read: http://stackoverflow.com/questions/23417356/facebook-graph-api-v2-0-me-friends-returns-empty-or-only-friends-who-also-u
------------------------------------------------------------------------------------------------------------------------------
In v2.0 of the Graph API, calling /me/friends
returns the person's friends who also use the app.
In addition, in v2.0, you must request the
user_friends
permission from each user.
user_friends
is no longer included by default in every login. Each user must grant the
user_friends
permission in order to appear in the response to
/me/friends
. See
the Facebook upgrade guide for more detailed information, or review the summary below.
If you want to access a list of non-app-using friends, there are two options:
-
-
------------------------------------------------------------------------------------------------------------------------------
References:
https://developers.facebook.com/docs/apps/faq
https://developers.facebook.com/docs/apps/changelog [Read API Version v2.0 changelog]
https://developers.facebook.com/docs/apps/upgrading#upgrading_v2_0_user_ids
[TODO]
https://developers.facebook.com/docs/graph-api/reference/v2.2/user/taggable_friends
https://developers.facebook.com/docs/graph-api/reference/v2.2/user/invitable_friends