Hi, my name is Nati and I’m a developer at Singular.
We opened another internal thread with our customer and their Twitter POC(Jason Najera), so to be aligned with both conversations, I will go ahead and share their job details.
The following is an example of a call we’ve set today to pull yesterday’s data for ad_account_id: 18ce54tq4xb for PROMOTED_TWEETS
The full API call:
https://ads-api.twitter.com/8/stats/jobs/accounts/18ce54tq4xb/?placement=ALL_ON_TWITTER&metric_groups=ENGAGEMENT,BILLING,MOBILE_CONVERSION,VIDEO&start_time=2021-01-09T00:00:00-0800&entity=PROMOTED_TWEET&with_deleted=true&end_time=2021-01-10T00:00:00-0800&granularity=DAY&entity_ids=54v64a,54v64c,54v64b,54v64e,54v64d&segmentation_type=PLATFORMS
The failures are sporadic and happen for some of our customers.
The failures started when the last rate limit issues have started.
However, as mentioned before, the failures didn’t always raise after rate limit errors.
Sharing here two other cases that occurred to other customers and seem related:
Another call that failed today, for a different customer, with ad_account_id: 18ce53x0yy2
https://ads-api.twitter.com/8/stats/jobs/accounts/18ce53x0yy2/?placement=PUBLISHER_NETWORK&metric_groups=ENGAGEMENT,BILLING,MOBILE_CONVERSION,VIDEO&start_time=2021-01-09T00:00:00-0800&entity=PROMOTED_TWEET&with_deleted=true&end_time=2021-01-10T00:00:00-0800&granularity=DAY&entity_ids=12g3vc,12g3vb,13a83a,13a83b,13a83c&segmentation_type=PLATFORMS
Please see the response header:
{'x-api-version': '8.0', 'content-length': '402', 'x-rate-limit-reset': '1610251336', 'x-rate-limit-remaining': '49821', 'x-xss-protection': '0', 'x-concurrent-job-limit': '100', 'x-content-type-options': 'nosniff', 'x-connection-hash': '3c2a6ac8aea137126e280c40632a6a2de535d2b9e5811b5e0bbd28297ba2bba8', 'x-account-rate-limit-reset': '1610250703', 'x-runtime': '0.019029', 'cache-control': 'no-cache, no-store, max-age=0', 'content-disposition': 'attachment; filename=json.json', 'x-access-level': 'read-write', 'x-current-api-version': '8.0', 'date': 'Sun, 10 Jan 2021 03:48:38 GMT', 'x-rate-limit-limit': '50000', 'x-account-rate-limit-remaining': '369', 'x-account-rate-limit-limit': '2000', 'x-transaction': '3b85efdf7aba0edf', 'content-encoding': 'gzip', 'strict-transport-security': 'max-age=631138519', 'server': 'tsa_devel', 'x-frame-options': 'SAMEORIGIN', 'content-type': 'application/json;charset=utf-8', 'x-concurrent-job-limit-remaining': '99'}
For another customer(ad_account_id: 4wjgic), we did experience rate limit, which was handled with your best practices instructions - calculating the waiting time with ‘x-rate-limit-reset’, wait it +more 20 sec that we added ones this issue started. However, it seems like the ‘x-rate-limit-remaining’ header didn’t show zero for this case.
Could you please look into the mentioned cases and share with us the best practices to handle them? Especially the issue of the jobs with status: FAILED since this case is not mentioned in the API docs.
Thanks, we’re looking forward to hearing from you,
Nati-An