开发者

List the members of a Facebook group via API

Is开发者_高级运维 is possible to list the members of a Facebook group using the Facebook API? If yes, how?


This is no longer possible:

This edge was deprecated on April 4th, 2018, and can no longer be used.


Yes - use the members connection. Check out the Group reference on the Graph API.


First you need an access token. I'd recommend this article:

http://benbiddington.wordpress.com/2010/04/23/facebook-graph-api-getting-access-tokens/

If you want a permanent access token you must ask for the "offline_access" extended permission on getting it.

After that, it's just a matter of issuing a REST API call:

https://graph.facebook.com/[GROUPID]/members?access_token=[ACCESSTOKEN]

and you'll receive a JSON list of all the members of that group. Very handy!


 Request request = new Request(Session.getActiveSession(),
                groupId+"/members", bundle,
                HttpMethod.GET, new Request.Callback() {}
Request.executeBatchAsync(request);


Check the members link on

http://developers.facebook.com/docs/reference/api/group

If you click on that link it will generate a oauth token for you, then simply substitute the groupid

It will only return 500 members though

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜