Himanshu Yadav
Himanshu Yadav

Reputation: 13587

Facebook: Getting name of the members

I am trying to name of the members of close friends list:

FB.api("/me/friendlists/close_friends?fields=members.fields(name)")

but it is not working.

FB.api("/me/friendlists/close_friends?fields=members")

gives me complete members object with following structure

Object {data: Array[1], paging: Object}
data: Array[1]
0: Object
id: "10150338266588525"
members: Object
data: Array[1]
0: Object
id: "812290716"
name: "My Friend"

Upvotes: 0

Views: 375

Answers (1)

thomasbabuj
thomasbabuj

Reputation: 3919

To read a FriendList, issue an HTTP GET request to /FRIENDLIST_ID with the read_friendlists permission.

FB.api("/FRIENDLIST_ID?fields=name,members.fields(name)")

You can also call like this, this returns name and id ( default), just ignore the userid, if you dont want.

FB.api("friendlists/close_friends?fields=members.fields(name)") 

Try FB Graph API Explorer, Hope this helps.

Upvotes: 1

Related Questions