【问题标题】:How to make Facebook API batch request into async如何使 Facebook API 批处理请求异步
【发布时间】:2021-10-08 23:53:05
【问题描述】:

这可以作为一个批量请求发布到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,但是结果不是异步的,结果是在请求结果中同步返回的。

【问题讨论】:

  • 有什么消息吗?有同样的问题

标签: facebook-graph-api facebook-marketing-api facebook-batch-request


【解决方案1】:

我没试过,但是这里的文档: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 以获得您的结果

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-01-10
    • 2023-02-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多