Facebook获取用户的个人资料信息

问题描述:

我正尝试使用他们的Facebook获取用户的个人资料信息,如姓名或电子邮件,但似乎没有工作了。是否仍有可能使用ID来获取其他用户的帐户信息: ?Facebook获取用户的个人资料信息

我得到使用Facebook SDK这个respose:

Fatal error: Uncaught exception 'Facebook\Exceptions\FacebookAuthenticationException' with message 'Unsupported get request. Object with ID '1691918994166305' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api ' in

/Applications/XAMPP/xamppfiles/htdocs/fizops.com/facebook/vendor/facebook/graph-sdk/src/Facebook/Exceptions/FacebookResponseException.php:106 Stack trace: #0 /Applications/XAMPP/xamppfiles/htdocs/fizops.com/facebook/vendor/facebook/graph-sdk/src/Facebook/FacebookResponse.php(210): Facebook\Exceptions\FacebookResponseException::create(Object(Facebook\FacebookResponse))

#1 /Applications/XAMPP/xamppfiles/htdocs/fizops.com/facebook/vendor/facebook/graph-sdk/src/Facebook/FacebookResponse.php(255): Facebook\FacebookResponse->makeException() #2 /Applications/XAMPP/xamppfiles/htdocs/fizops.com/facebook/vendor/facebook/graph-sdk/src/Facebook/FacebookResponse.php(82): Facebook\FacebookRes in /Applications/XAMPP/xamppfiles/htdocs/fizops.com/facebook/vendor/facebook/graph-sdk/src/Facebook/Exceptions/FacebookResponseException.php on line 106

使用这个网址:

https://graph.facebook.com/1777651498915121/?access_token=xxx|xxx 

响应:

{ "error": { "message": "Unsupported get request. Object with ID '1777651498915121' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api ", "type": "GraphMethodException", "code": 100, "fbtrace_id": "HYwXjUHaT8W" } }

+1

你从哪里得到用户ID?它实际上是属于你的应用程序的应用程序范围的ID吗? – CBroe

+1

只是使用/我而不是用户ID - 当然用户访问令牌 – luschn

+0

我从Reamaze获得了用户ID,他们说我可以使用图形api将其追溯到Facebook。 – Boy

最有可能的,你指定了错误的USER_ID,我用错误的user_id尝试并获得相同的错误。你可以尝试了解它是如何工作的。 https://developers.facebook.com/tools/explorer,选择您的应用程序,获取用户访问令牌并推送提交。

我尝试了一下,发现每个应用程序都有不同的user_id,并且在使用其他应用程序的user_id时会出现此类错误。

+0

我可以使用他们的ID获取他们的个人资料照片。但技术上真的只需要他们的名字和电子邮件就可以与订单进行核对。我试过你的链接,但给我同样的错误。我尝试了多个ID。只适用于我的个人ID。 – Boy

+0

据我所知,Facebook SDK不提供这样的机会。您只能从允许您这样做的用户那里接收数据。 –