2016-04-09 53 views
0

你好,我想使用facebook图形API v2.5获取一些事件信息,但我不断收到错误消息facebook.GraphAPIError:未知路径组件:/ 144259682284406。它的工作原理没有字段时,我不但是指定V2.5我需要使用V2.5,以获得必要的字段使用facebook图形API获取事件数据的问题v2.5

/v2.5/144259682284406?fields=events{name,id,timezone,start_time,end_time,picture,description,category,type,attending_count,interested_count,declined_count} Blockquote

+0

不清楚你在问什么;完全相同的请求[在Graph API Explorer中正常工作](https://developers.facebook.com/tools/explorer?method=GET&path=144259682284406%3Ffields%3Devents%7Bname%2Cid%2Ctimezone%2Cstart_time%2Cend_time%2Cpicture%2Cdescription %2Ccategory%2Ctype%2Cattending_count%2Cinterested_count%2Cdeclined_count%7D&version = v2.5) – CBroe

+0

等等https://graph.facebook.com/v2.5/144259682284406?fields=events%7Bname%2Cid%2Ctimezone%2Cstart_time%2Cend_time %2C图片%2C描述%2C类别%2C类型%2Cattending_count%2Cinterested_count%2Cdeclined_count%7D&access_token = ...直接在浏览器中调用时。 – CBroe

+0

@CBroe我使用python并调用graph.get_object方法。 Python代码:“searchstring =(”/v2.5/144259682284406?fields=events{name,id,timezone,start_time,end_time,picture,description,categor y,type,attending_count,interested_count,declined_count}“)post = graph .get_object(searchstring)“ – MattP

回答

0

完全相同的请求,在图形API资源管理工作或致电通过URL API时直接 - 所以它必须是你在SDK代码中传递参数的方式。

检查http://facebook-sdk.readthedocs.org/en/latest/api.html事实证明,该API版本有创建facebook.GraphAPI对象实例时传递,

graph = facebook.GraphAPI(access_token='your_token', version='2.2') 

这样的SDK将采取把该版本字符串到URL的照顾了API请求是由它自己完成的,因此,在进行API调用的以下代码中,您不必再考虑这一点。

0

试试这个;)

的ID您使用144259682284406是一个网页对象,如果你想获得页面事件,你应该查询是这样的:你的情况

page/events/?fields=field1,field2,...

/v2.5/144259682284406/events/?fields=name,id,timezone,start_time,end_time,picture,description,category,type,attending_count,interested_count,declined_count