简体   繁体   English

从Facebook Graph API /用户获取“真实”个人资料网址

[英]Get “real” profile URL from Facebook Graph API /user

As stated in the API docs for /user , the link field contains the user's profile URL. /userAPI文档中所述, link字段包含用户的配置文件URL。 However, this URL commonly redirects to a different URL (ie the one that shows up in Google results). 但是,此网址通常会重定向到其他网址(即显示在Google搜索结果中的网址)。

Is there any way to determine the final redirect location (the "real" URL) of a given profile via the Facebook API? 有没有办法通过Facebook API确定给定配置文件的最终重定向位置(“真实”URL)?

For example, given: 例如,给定:

"link":"https://www.facebook.com/1091552020"

I want to retrieve https://www.facebook.com/sbhutiani from the API 我想从API中检索https://www.facebook.com/sbhutiani

You can´t get the real ID or the username of users anymore, so there is no way to get the "real URL". 您不能再获得真实ID或用户名,因此无法获得“真实URL”。 More information: https://developers.facebook.com/docs/apps/changelog 更多信息: https//developers.facebook.com/docs/apps/changelog

You can get a link to the user profile with the following API call though: /me?fields=link 您可以通过以下API调用获取用户配置文件的链接: /me?fields=link

Check out "App Scoped IDs" in the Facebook docs. 查看Facebook文档中的“App Scoped IDs”。

Update: It seems that linking to the user profile is not possible anymore: https://developers.facebook.com/blog/post/2018/04/19/facebook-login-changes-address-abuse/ 更新:似乎无法再链接到用户配置文件: https//developers.facebook.com/blog/post/2018/04/19/facebook-login-changes-address-abuse/

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

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