我正在尝试使用Facebook Graph API请求Instagram商家帖子的API。
这将成功返回Instagram商业账户中最近的25篇帖子,以及json中分页光标部分的“after”字段。但是,现在我正在尝试使用某种形式的分页来获取接下来的25篇帖子。我已经了解到Facebook Graph API支持游标和基于时间的分页,但以下文章表明Business Discovery的/media端点仅支持基于游标的分页。
任何有关如何格式化这些查询字符串以执行Instagram媒体对象的分页(使用after/before参数、时间戳或post_ids)的帮助将不胜感激。
https://developers.facebook.com/docs/instagram-api/business-discovery
使用Facebook的Graph API Explorer,我正在调用。 <my_facebook_page_id>?fields=business_discovery.username(<instagram_business_account_username>){media{comments_count,like_count, caption, media_url, media_type,timestamp}}
这将成功返回Instagram商业账户中最近的25篇帖子,以及json中分页光标部分的“after”字段。但是,现在我正在尝试使用某种形式的分页来获取接下来的25篇帖子。我已经了解到Facebook Graph API支持游标和基于时间的分页,但以下文章表明Business Discovery的/media端点仅支持基于游标的分页。
https://developers.facebook.com/docs/instagram-api/reference/user/business_discovery#pagination
我尝试了几种以上查询的变化,试图获取下一个25篇文章,但所有这些查询都返回最近的25篇文章(与上面的初始查询相同)。
以下是我尝试过的一些查询示例。
<my_facebook_page_id>?fields=business_discovery.username(<instagram_business_account_username>){media{comments_count,like_count, caption, media_url, media_type,timestamp}}&after=<after_code_from_first_call>
<my_facebook_page_id>?fields=business_discovery.username(<instagram_business_account_username>).after(<after_code_from_first_call>){media{comments_count,like_count, caption, media_url, media_type,timestamp}}
任何有关如何格式化这些查询字符串以执行Instagram媒体对象的分页(使用after/before参数、时间戳或post_ids)的帮助将不胜感激。
谢谢。