fbsamples / audience-network

Open source projects to demonstrate SDK and sample code usages and integration, and to collaborate and support peers in this community.
https://developers.facebook.com/docs/audience-network
Other
319 stars 370 forks source link

Reporting API async flow: how long do we need to wait after getting the query_ids #108

Closed louisguitton closed 3 years ago

louisguitton commented 4 years ago

In the samples readme, you say

After you fetch query ids successfully, please wait for a few seconds (i.e. 10 seconds) before you send another "async" request with query ids such that you are guaranteed to get results. Also, please do not try to request more than 50 times within 60 seconds.

In the docs, there is nothing specified for this.

We implemented a custom API client for the Facebook Audience Network Reporting API, we're trying to fetch the reports for 1 day, breakdowns=["country", "placement_name"] (we have 26 placements and 225 countries), for 5 metrics. We're already using filters to batch the countries 5 by 5. We're already waiting 30 seconds between the successful async POST request and the async GET request. We've tried retrying and waiting for the async GET request, in the same fashion than https://github.com/fbsamples/audience-network/blob/master/samples/python/ReportingAPISamples/adnw_examples.py#L83-L93

Yet, we're still at some point rate limited it seems because we get the following response

{
   "data": [
      {
         "query_id": "2438fb3df7d59905e2897dc88592a3c1",
         "status": "requested"
      }
   ]
}

What are we doing wrong? what are the suggested approaches? Where can I find the documentation for the "status" logic in the response of the GET /v5.0/{application-id}/adnetworkanalytics_results docs here

sherifelkhatib commented 3 years ago

Hey @louisguitton, please check the latest documentation and if the problem persists, please report it on the publisher support portal.