如何使用FB Graph API从事件中获得出席嘉宾的数量?

问题描述:

我想用Facebook Graph API v2.1来参加活动。我无法使用FQL查询,因为它在当前版本后不推荐使用。如何使用FB Graph API从事件中获得出席嘉宾的数量?

我可以使用/{事件ID} /主治,总结所有的客人,但是这种解决方案是非常无效(查询了很长时间进行 - 通常> 2000毫秒,而且只针对工作〜1000人,而不是更多)。

如果您打电话给事件ID本身,您可以添加attending_countdeclined_countmaybe_count的字段以轻松获得总计。

例子:

https://graph.facebook.com/{event_id}?fields=attending_count,declined_count,maybe_count 

如果我做了以下内容:

https://graph.facebook.com/468185256651918?fields=attending_count,declined_count,maybe_count 

我看到:

{ 
    "attending_count": 304, 
    "declined_count": 277, 
    "maybe_count": 97, 
    "start_time": "2014-09-06T20:00:00+0100", 
    "id": "468185256651918" 
} 
+1

非常感谢!还有一个问题:你怎么知道的?我阅读了API文档,但是我没有找到这些信息。 – ZaquPL 2014-09-04 21:05:08

+1

我在以下参考页面找到了这些字段:https://developers.facebook.com/docs/graph-api/reference/v2.1/event/ – 2014-09-05 11:49:45