如何在 Facebook Graph API v2.1 中通过用户名获取用户 ID [英] How to get User id by username in Facebook Graph API v2.1

查看:29
本文介绍了如何在 Facebook Graph API v2.1 中通过用户名获取用户 ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在开发一个网络应用程序,并通过 FQL 使用用户名来获取用户 ID.不幸的是,Graph API v2.1 不再支持 FQL.我还没有找到如何在文档中引用用户名来查找用户 ID 的方法.

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.

有解决办法吗?或者这对于 Graph API 是不可能的.我知道我可以使用名称查询用户 ID,但是使用用户名,在我们的场景中会更好.

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.

推荐答案

这是出于隐私原因故意的.如果您能够获得具有唯一用户名的(真实)用户 ID,则根本不需要发明 App Scoped ID.

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.

如果调用/me/username,会返回如下错误:

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

(#803) 无法通过用户名查询用户

(#803) Cannot query users by their username

顺便说一句,从 v2.0 开始,您甚至无法获取用户名,只能获取真实姓名.

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

这篇关于如何在 Facebook Graph API v2.1 中通过用户名获取用户 ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆