Facebook API查询子对象

问题描述 投票:0回答:1

我有兴趣在单个请求中获取给定页面的帖子生命周期见解。

前一个问题做了一半的工作:Get posts with insights from a single API call - Facebook Graph API

这使我能够通过以下方式获取单个请求中所有帖子的见解:

/{page-id}/posts?fields=insights.metric(post_impressions_fan,post_engaged_users)

但这些并不总是终生的见解,我想为子对象指定period=lifetime

我在Facebook Graph API中如何做到这一点?

我试过了:

  • 添加insights.period(lifetime)哪个错误:“字段见解多次指定。这只能在版本2.1之前”
  • 仅作为insights{metric(post_impressions_fan,post_engaged_users),period(lifetime)}进行一次见解,但失败了“预期结束字符串而不是\”(\“。”
facebook-graph-api facebook-insights
1个回答
0
投票

您可以使用此API调用来获得终身帖子洞察:

{page_id}/posts?fields=id,name,type,shares,link,permalink_url,created_time,picture,comments.summary(true).limit(0),likes.summary(true).limit(0),reactions.summary(true).limit(0)&period=lifetime&limit=100

使用分页来获取所有帖子,因为我们可以设置的最大限制是100。

© www.soinside.com 2019 - 2024. All rights reserved.