But then I think I need to first :execute, parse the response and then construct the download URL.
Is there a slicker way to do this with one REST call? If not in 4.2, is it possible in a newer version?
One more thing I noticed in KS 4.2. In the Swagger UI I couldn’t put slashes into workflow paths when testing REST calls. The workaround was to move my workflow to the repository root. Is that an already known issue? Is it fixed already in a newer version?
unfortunately I don’t think this is possible at the moment. A workflow job can create an outputResources field which lists all available resources the job has created. This can of course also be dynamic if for example container nodes where configured with flow variables or part of active/inactive branches in the workflow. This field is listed wherever a job is returned in a REST response. This could be in the regular jobs/{uuid} get endpoint and also in the :execution endpoint.
The only call to download a generated output resource is then jobs/{uuid}/output-resources/{resourceId} where you need to provide both the job id and the resource id from a previously parsed response.
This is something we also recently realized and this seems to be a bug in swagger. We don’t have an update for this yet.
However, you can access /rest/v4/repository/{path/to/workflow}:openapi to get tests that already have the path baked in, where the path will not falsely be encoded (this is also the link that is opened, if you right click a server workflow in an Analytics Platform and select “Show API Definition”).
How can I now retreive now the csv. It is mentioned as “output resources”, as far as I can tell, yet I was not able to generate the download. Help would be very much appreciated
Solved my issue.
Triggering a file download needs to first execute the REST call via:
REQUEST_URL:jobs
and not
REQUEST_URL:execute
The latter discards the job.
Once this query is executed correctly, it generates a request ID, which then can be used for a file download.
The specified parameter name from the output node needs to be referenced: