How to get User id by username in Facebook Graph API v2.1

余生长醉 提交于 2019-11-28 04:56:54

问题


we are developing a web app and were getting the user ids by using the username via FQL. Unfortunately, Graph API v2.1 does not support FQL anymore. I haven't found a way how to reference the username to find the user id in the documentation.

Is there a solution? Or is that not possible with the Graph API. I know that I can query the user ID using the name, but with the username, it would be better in our scenario.


回答1:


This is intentional for privacy reasons. If you would be able to get the (real) User ID with the unique username, there would be no need to invent App Scoped ID at all.

If you make a call to /me/username, it will return the following error:

(#803) Cannot query users by their username

Btw, you cannot even get the username since v2.0, only the real name.



来源:https://stackoverflow.com/questions/25306754/how-to-get-user-id-by-username-in-facebook-graph-api-v2-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!