Use GET /job/file/<job_id>
to download all the results of a job in a zipped archive.
Use GET /job/file/<job_id>/<file name>
to download a specific file in the results of a job.
A successful GET /job/file/<job_id>
transaction returns a zipped archive file named <job_id>.zip, which contains all the contents of the simulation output.
A successful GET /job/file/<job_id>/<file name>
transaction returns the contents of the named file in the simulation results.
Send the GET /job/file
command to download all results using curl:
curl -b cookies https://api.ensims.com/jess_web/api/job/file/12249
On success, the job's simulation results will be packed and returned in a zip archive. If the job is not accessible or the existing JWT is invalid, an HTTP 401 Unauthorized code will be returned.
To download only one result file:
curl -b cookies https://api.ensims.com/jess_web/api/job/file/12249/eplusout.err
On success, the contents of the eplusout.err
file will be returned. If the job is not accessible or the existing JWT is invalid, an HTTP 401 Unauthorized code will be returned.
Make sure Requests is correctly installed in your Python environment, and run the following lines:
import requests # Existing cookies are expected to be stored in the variable 'cookies' r = requests.get('https://api.ensims.com/jess_web/api/job/file/12249', cookies=cookies) # Save returned zip file open('12249.zip', 'wb').write(r.content) # Existing cookies are expected to be stored in the variable 'cookies' r = requests.get('https://api.ensims.com/jess_web/api/job/file/12249/eplusout.err', cookies=cookies) # Save returned zip file print(r.text)