tags:

views:

99

answers:

1

We have over 10,000 registered users on our site and want to associate each user with a Facebook account with their facebook ID. Our site uses the WWW::Facebook::API CPAN module for all our other Facebook related actions on our site. My question is, is there a method where we can provide a specific user's email address (which they have provided to us during registration) and have the Facebook API return the matching user's Facebook user_id? To be clear we don't want the get the user's email through the Facebook API, but instead want to look them up using their email address. If there is it would be really helpful to see a code snippet of how this would work. Bonus points if this can done through the CPAN module we are already using. Thanks in advance for your help!

+3  A: 

Yes, you can. In a way.

The new Search API allows you to search publicly available information about users.

https://graph.facebook.com/[email protected]&type=user

As long as the email address you are searching for is public on Facebook (i.e., the user has it set that way in their preferences), it will return the user's name and Facebook ID.

The JSON

{
   "data": [
      {
         "name": "John Doe",
         "id": "123456789"
      }
   ]
}
Peter Bailey
Russell C.
I'm not a perl guy, sorry. Is it not documented in any way for you?
Peter Bailey
Not the 100% solution I was looking for but got me started in the right direction. Thanks Peter!
Russell C.