0

对于公共组https://www.facebook.com/groups/359484787507661/,我通过以下代码获取组信息:

Group group = facebookClient.fetchObject("359484787507661", Group.class);

但我无法访问以下公共群组网址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中的用户名来获取组?

4

1 回答 1

1

您可以使用 Search API 通过名称获取组 ID:

/search?type=group&q={group-name}

当然,您可能会得到多个组,它是带有 ID 的组列表。

于 2016-01-20T09:54:50.853 回答