2

这可以作为发布到https://graph.facebook.com的批处理请求正常工作,并将以下内容作为“batch=”参数,但是如何使其成为异步请求?

[{                                                                      
  "method": "GET",
  "relative_url": "v11.0/act_xxxxxx/insights?fields=account_id%2Caccount_name..."
},
{
  "method": "GET",
  "relative_url": "v11.0/act_yyyyyy/insights?fields=account_id%2Caccount_name..."
}]

我尝试过发帖到https://graph.facebook.com/v11.0/act_xxxxxx/async_batch_requests,但结果不是异步的,结果是在请求结果中同步返回的。

4

1 回答 1

2

我还没有尝试过,但这里的文档:https ://developers.facebook.com/docs/marketing-api/insights/best-practices#asynchronous建议你做:

  • 一个POST电话/insights得到一个report_run_id
  • GET调用/:report_run_id直到你得到async_status: "Job Completed"结果async_percent_completion: 100
  • GET打电话给/:report_run_id/insights你的结果
于 2021-11-19T09:10:26.157 回答