Not getting Job IDs in first try when using stats API end point



Twitter stats API end point (GET /1/stats/jobs/accounts/:account_id
) is frequently failing to give job_ids in first try. We need to try multiple times to get job_ids. Can you please look into it and update us on why this might happen and what is the best way to resolve it (other than trying multiple times). I have attached relevant screen shot, let me know if you need further details.



If this is a daily task checking jobs from previous day, it could fail to find some job IDs because of this limitation: “Result files expire 48 hours after the job is successful and the URL is returned.” The jobs are not permanent entities, you should basically wait to get the data and only use job ID to index into the details about it. If the way your reporting is looking up data to download the files from us - I would recommend instead to sync them sort of gradually as the day progresses and then they will already be in a database on your side by the time you want to compile a report. Basically doing anything in “batch” with lots of consecutive requests will end up more likely to cause errors and heavy load on our end, it’s better to keep the calls smooth through a day using queues and so on.

I hope this helps, if not please post the HTTP GET endpoint being called when it receives the error (and the response body) - deleting any sensitive information like keys/secrets. I could not find this account ID appearing in our history of errors for last 7 days so I’m wondering if the issue is something like failure to download the file and just getting the same error message appearing. An occassional failure to download file from our file storage server is a somewhat known issue over scaled number of attempts.