通过电子邮件地址获取Facebook用户ID

通过电子邮件地址获取Facebook用户ID

本文介绍了通过电子邮件地址获取Facebook用户ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在我们的网站上拥有10,000多名注册用户,并希望将每个用户与具有其Facebook ID的Facebook帐户相关联.我们的网站对我们所有网站均使用 WWW :: Facebook :: API CPAN模块我们网站上其他与Facebook相关的操作.我的问题是,有没有一种方法可以提供特定用户的电子邮件地址(他们在注册时提供给我们的地址),并让Facebook API返回匹配用户的Facebook user_id?需要明确的是,我们不希望通过Facebook API获取用户的电子邮件,而是希望使用他们的电子邮件地址来查找他们.如果有的话,查看如何工作的代码片段将非常有帮助.如果可以通过我们已经在使用的CPAN模块完成此操作,则可获得加分.预先感谢您的帮助!

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!

推荐答案

是的,可以.在某种程度上.

Yes, you can. In a way.

新的搜索API 允许您搜索有关用户的公开信息.

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

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

只要您要搜索的电子邮件地址在Facebook上是公开的(即用户在其首选项中设置了该电子邮件地址),它就会返回用户名和Facebook ID.

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.

JSON

{
   "data": [
      {
         "name": "John Doe",
         "id": "123456789"
      }
   ]
}

这篇关于通过电子邮件地址获取Facebook用户ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 01:17