facebook-graph-apifacebook-marketing-apifacebook-batch-request

How to make Facebook API batch request into async


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.


Solution

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