简体   繁体   English

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

[英]Facebook fetch user's profile info

I'm trying to fetch the user's profile info like name or email using their Facebook but it doesn't seem to work anymore. 我正在尝试使用其Facebook来获取用户的个人资料信息,例如姓名或电子邮件,但似乎不再起作用。 is it still possible to get another user's account info using the ID? 是否仍可以使用ID获得其他用户的帐户信息?

I get this respose using the Facebook sdk: 我使用Facebook SDK来解决这个问题:

Fatal error: Uncaught exception 'Facebook\\Exceptions\\FacebookAuthenticationException' with message 'Unsupported get request. 致命错误:带有消息“不支持的获取请求”的未捕获异常“ Facebook \\ Exceptions \\ FacebookAuthenticationException”。 Object with ID '1691918994166305' does not exist, cannot be loaded due to missing permissions, or does not support this operation. ID为'1691918994166305'的对象不存在,由于缺少权限而无法加载或不支持此操作。 Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api ' in 请通过以下网址阅读Graph API文档: https://developers.facebook.com/docs/graph-api

/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)) /Applications/XAMPP/xamppfiles/htdocs/fizops.com/facebook/vendor/facebook/graph-sdk/src/Facebook/Exceptions/FacebookResponseException.php:106堆栈跟踪:#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 #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):/Applications/XAMPP/xamppfiles/htdocs/fizops.com/facebook/vendor中的Facebook \\ FacebookRes /facebook/graph-sdk/src/Facebook/Exceptions/FacebookResponseException.php在第106行

Using this url: 使用此网址:

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

Response: 响应:

{ "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" } } {“ error”:{“ message”:“不支持的获取请求。ID为'1777651498915121'的对象不存在,由于权限丢失而无法加载,或者不支持此操作。请阅读Graph API文档, 网址https:// /developers.facebook.com/docs/graph-api “,” type“:” GraphMethodException“,” code“:100,” fbtrace_id“:” HYwXjUHaT8W“}}

Most likely, you specified the wrong user_id, I tried with the wrong user_id and the same error is obtained. 很可能您指定了错误的user_id,我尝试使用错误的user_id并获得了相同的错误。 You can try to understand how it works here. 您可以尝试在这里了解其工作原理。 https://developers.facebook.com/tools/explorer , select your Application, Get User Access Token and push Submit. https://developers.facebook.com/tools/explorer ,选择您的应用程序,获取用户访问令牌,然后按提交。

I experimented a little, and noticed that for each application there are different user_id's and you will have such error when you will use the user_id of another application. 我做了一些实验,发现每个应用程序都有不同的user_id,使用另一个应用程序的user_id时会出现此类错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM