2

This works fine as a batch request posting to https://graph.facebook.com, with the following as the 'batch=' parameter, but how do I make it an async request?

[{                                                                      
  "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..."
}]

I have tried posting to https://graph.facebook.com/v11.0/act_xxxxxx/async_batch_requests, but results are not asynchronous, and results are returned synchronously in the request result.

runrig
  • 6,486
  • 2
  • 27
  • 44

1 Answers1

2

I haven't tried it, but the doc here: https://developers.facebook.com/docs/marketing-api/insights/best-practices#asynchronous suggest that you make:

  • A POST call to /insights to get a report_run_id
  • GET calls to /:report_run_id until you get a result with async_status: "Job Completed" and async_percent_completion: 100
  • A GET call to /:report_run_id/insights to get your results
Thierry J.
  • 2,148
  • 16
  • 23