[To be updated]
To retrieve the values of report variables in an ESO or a MTR file, you can use 4 forms of the transaction, depending on where the file is located:
GET /eso/var/<job_ID>/<file_name>?pid=<run_period_ID>&vars=<var_ID1,var_ID2…>
GET /eso/var/<job_ID>/<case_name>/<file name>?pid=<run_period_ID>&vars=<var_ID1,var_ID2…>
GET /eso/var/<job_ID>/<file_path>?pid=<run_period_ID>&vars=<var_ID1,var_ID2…>
GET /eso/var/<job_ID>/<file_ref>?pid=<run_period_ID>&vars=<var_ID1,var_ID2…>
pid=<period_ID>
and vars=<var1_ID,var2_ID,…>
A successful /eso/var
transaction returns an object containing the values of a specified run-period of the specified variable in the ESO/MTR file.
[ { "values": [ [ 3.155328E11, 1.122381E10 ], [ 3.182112E11, 9.8838E9 ], [ 3.207168E11, 1.056807E10 ], [ 3.233916E11, 1.077714E10 ], [ 3.259836E11, 1.122381E10 ], [ 3.28662E11, 1.01214E10 ], [ 3.31254E11, 1.122381E10 ], [ 3.339324E11, 1.089594E10 ], [ 3.366108E11, 1.044927E10 ], [ 3.392028E11, 1.122381E10 ], [ 3.418848E11, 1.044927E10 ], [ 3.444768E11, 1.089594E10 ] ], "domain": "Meter", "varId": 24, "var": "Electricity:Building", "unit": "J", "period": 0, "frequency": "Monthly" } ]
Send the /eso/var
command using curl:
curl -b cookies https://api.ensims.com/jess_web/api/eso/var/12251/eplusout.mtr/0/24
Or if it is a jEPlus project,
curl -b cookies https://api.ensims.com/jess_web/api/eso/var/12264/EP_0-T_0-W_0-P1_5-P2_0-P3_0-P4_0/eplusout.mtr/0/762
On success, the variable values will be returned in a JSON object. If the requested file does not exist, an HTTP 404 Not Found error will be returned. If the job is not accessible to the current user, 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/eso/var/12251/eplusout.mtr/0/24', cookies=cookies) # Or, if it is a jEPlus project r = requests.get('https://api.ensims.com/jess_web/api/eso/var/12264/EP_0-T_0-W_0-P1_5-P2_0-P3_0-P4_0/eplusout.mtr/0/762', cookies=cookies) # Show returned object r.json()