开发者

How can I display in 1 page all my users name and email from Facebook?

开发者 https://www.devze.com 2023-02-10 08:02 出处:网络
Got the idea?开发者_C百科 Is there any query to pull all users name and email from my Facebook APP via Graph Api?

Got the idea?开发者_C百科 Is there any query to pull all users name and email from my Facebook APP via Graph Api?

BTW I have the extended authorization on email field ;-)

The idea is displaying all the info in pairs like...

Name ; Email

You know what I'm talking about ;-) ?

Cheers!


Actually it's pretty easy, however first you need to get an access token. For information on how to get an access token go to http://developers.facebook.com/docs/reference/api

Once you have that token, you can query the graph for id's, and ask for data. Here's what the call would look like to query a single user.

https://graph.facebook.com/user1&access_token=ACCESS_TOKEN_HERE

If you want to grab multiple users, then you can use the ids parameter and it will grab all those records for you. I think the max is around 25 ids iirc. These are comma delimited.

https://graph.facebook.com/?ids=user1,user2&access_token=ACCESS_TOKEN_HERE

If you want a bit more information you can also append &metadata=1 to get a lot more metadata returned with each node.

https://graph.facebook.com/user1&metadata=1&access_token=ACCESS_TOKEN_HERE

Once you make the call you will need to parse the json objects returned, but that should be trivial.

Hope this helps you out.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号