Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/magento/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Facebook InsightsAPI通话限制为25条_Facebook_Facebook Marketing Api - Fatal编程技术网

Facebook InsightsAPI通话限制为25条

Facebook InsightsAPI通话限制为25条,facebook,facebook-marketing-api,Facebook,Facebook Marketing Api,我对编程非常陌生,我目前正尝试使用Facebook的InsightsAPI来提取我们的性能数据。问题是API调用的响应限制为25个条目 我使用以下代码进行呼叫: String access_token = "xxx"; String ad_account_id = "yyy"; setApp_secret("zzz"); APIContext context = new APIContext(access_token).enableDebug(false); APINodeList<Ad

我对编程非常陌生,我目前正尝试使用Facebook的InsightsAPI来提取我们的性能数据。问题是API调用的响应限制为25个条目

我使用以下代码进行呼叫:

String access_token = "xxx";
String ad_account_id = "yyy";
setApp_secret("zzz");

APIContext context = new APIContext(access_token).enableDebug(false);
APINodeList<AdsInsights> response = new AdAccount(ad_account_id,   context).getInsights()
  .setLevel(AdsInsights.EnumLevel.VALUE_CAMPAIGN)
.setBreakdowns(Arrays.asList(AdsInsights.EnumBreakdowns.VALUE_COUNTRY))
  .setTimeRange("{\"since\":\"2017-09-01\",\"until\":\"2017-09-30\"}")
 .requestField("account_id")
 .requestField("campaign_id")
 .requestField("impressions")
 .requestField("clicks")
  .execute();
字符串访问\u token=“xxx”;
字符串ad_account_id=“yyy”;
setApp_机密(“zzz”);
APIContext context=新的APIContext(访问令牌)。enableDebug(false);
APINodeList response=new AdAccount(ad_account_id,context).getInsights()
.setLevel(AdsInsights.EnumLevel.VALUE_活动)
.setBreakdowns(Arrays.asList(AdsInsights.EnumBreakdowns.VALUE_COUNTRY))
.setTimeRange(“{”自\“:\”2017-09-01 \“,\”至\“:\”2017-09-30 \“}”)
.requestField(“帐户id”)
.requestField(“活动id”)
.requestField(“印象”)
.requestField(“单击”)
.execute();
如何延长响应的限制?我找到了一些关于如何通过curl实现这一点的信息,但没有关于如何使用java实现这一点的提示。如果你们中有人能帮助我,那就太好了

祝你一切顺利,
Paul

Graph API的所有响应都是分页的,这意味着您最多可以得到“x”个结果,其中“x”目前默认为25个

您可以使用
limit
param指定更高的值,但不建议这样做,因为这可能会导致超时


您应该研究如何使用分页:

“但是没有关于如何使用java进行分页的提示”-SDK的自述文件中有一个非常明显的提示,“**重要**:处理分页:大多数边缘API都有默认分页,它返回有限数量的对象(~30个对象)而不是整个列表。如果你想加载更多,你需要进行单独的API调用。在我们的SDK中,你可以调用nextPage()获取下一页“谢谢!这对我的孩子帮助很大。不知怎的,我跳过了这个信息!