I want to use the request to determine the latest completed job (highest JobId).
If I don’t supply any limit/offset I get 52 processes, including the latest one (JobId 136). This is exactly the list shown in the Data Export tab (presumably generated by the same request).
My doubt is: what happens when I have 500 jobs in the list? Will the latest job always be among those returned?
Ideally I would request jobs with limit 1, expecting to get the latest job.
When I do this, however, I get job 94.
Does anyone have an idea:
what determines the order of jobs returned in this request?
or another way how to determine the JobId of the latest completed export process?
I would just like to mention why it can be important to determine the latest completed export process:
In a monitoring app for a survey with huge amounts of interviews (e.g. a census) it is important not to generate unnecessary export files, because that consumes huge amounts of time and storage space.
So for a monitoring request I want to determine if there already exists an export file for the current date.
If so, I just download it, otherwise I generate a new export file.
This way any number of monitoring requests during a day (could be hundreds if supervisors need this monitoring functionality) will generate a single export file.
I haven’t dealt with this endpoint in a long time.
Does it return the count of all jobs? (For the list of assignments, /api/v1/assignments/ returns TotalCounts. From the API documentation, I don’t see any similar info being returned about export jobs.)
If so, would it make sense to compile all jobs, making a request for each page of jobs, and from that compilation identifying the latest job?
If not, this seems like a reasonable feature request:
Have the endpoint return the total count of export jobs
@arthurshaw2002 No, it doesn’t return a total count. If it would I would have the latest jobID.
@zurab Yes, that would be a workaround. But I would have to get all the export processes to be sure the latest is among them. If the request without any limit/offset returns the latest jobs (as it does for the limited number of jobs I have at the moment) it would be a solution. But does it do this always?
@vitalii Thank you. In which way has it been fixed? Does it return the jobs in the order of recency now?
@klaus There was an issue that sorting was applied only to the specific batch(page) of the results but not to the whole set. Now the sorting applies first and then slicing imposed.