【发布时间】:2026-02-09 11:35:02
【问题描述】:
对于一个公共群组https://www.facebook.com/groups/359484787507661/,我通过以下代码获取群组信息:
Group group = facebookClient.fetchObject("359484787507661", Group.class);
但我无法访问以下公共组 url https://www.facebook.com/groups/therealheronarendramodi 的组信息。
Group group = facebookClient.fetchObject("therealheronarendramodi", Group.class);
我收到以下错误:
Exception in thread "main" com.restfb.exception.FacebookOAuthException: Received Facebook error response of type OAuthException: (#803) Some of the aliases you requested do not exist: therealheronarendramodi (code 803, subcode null)
如何通过用户名获取 facebook 公共群组信息?有什么方法可以通过restfb api中的用户名获取组?
【问题讨论】:
-
不,您无法通过群组名称获取群组信息,您需要他们的 ID。你也不能从组名中得到它。此外,Facebook 已将群组的访问权限限制为用户在其最新 API 版本中作为管理员的群组。
标签: facebook facebook-graph-api facebook-fql restfb facebook4j