Empty data array returned in response to GET /1/stats/jobs/accounts/:account_id endpoint

bug
ads
api
stats
async

#1

Hi,

We have been using the async Ads API to get stats for a while now.
Ocassionally, our calls to GET /1/stats/jobs/accounts/:account_id endpoint to get the status of the job_id(s) we obtained by a call to POST /1/stats/jobs/accounts/:account_id immediately before.
The call is as below:

GET https://ads-api.twitter.com/1/stats/jobs/accounts/18ce54gsu9o?job_ids=847974365585068032

The response obtained was:
{"request":{"params":{"job_ids":[847974365585068032]}},"data_type":"job","next_cursor":null,"data":[]}

The exact date time of this call was 01 Apr 2017 00:50:18,423 in case this helps.

The documentation for the GET endpoint doesn’t specify this as being a valid response. Could you please explain why this happens and what can be done to resolve this.


#2

Hey,

Thanks for sending this report. If the call is literally milliseconds after the POST, it might be possible that the job has not yet be enqueued to the worker that processes these requests, thus we do not return anything about it. Since the data will take at least a second or two to process and prepare, I would recommend to include a backoff here anyway as you await results. It’s better to continue to wait for the result (possibly with exponential backoff) unless you manually cancel the request with the DELETE endpoint after some cutoff time like 5 or 10 minutes.

If the job persistently doesn’t appear even minutes later, it would be a different issue so let us know if it’s more of a persistent problem.

Thanks,

John


#3

Thanks for the quick response. That certainly makes sense.

Thanks,
Joel


#4

The job doesn’t appear even minutes later; account_id= rm61b; job_ids=92359674440277200; can you let me know what the issue might be?