Back to JESS API

Get IDF Object or Objects of a Certain Type


Use GET /idf/<job_ID>/<file name>/<type_name>/<obj_id> to retrieve the specific object of the specified type. If the obj_id has a minus value, it returns all the objects of the specified type.

or GET /idf/<job_ID>/<case_name>/<file name>/<type_name>/<obj_id> for a jEPlus project


Synopsis

Return object

A successful /idf transaction returns an object containing the object of a specified object type in the IDF file, along with the type definition. If the obj_id is set to -1, all object of the same type are returned, as shown below.

{
    "type": {
        "fields": [
            {
                "id": "A1",
                "required": true,
                "defs": {
                    "field": [
                        "Name"
                    ],
                    "required-field": [
                        ""
                    ],
                    "type": [
                        "alpha"
                    ],
                    "reference": [
                        "PeopleNames"
                    ]
                }
            },
            ...
        ],
        "required": false,
        "unique": false,
        "defs": {
            "memo": [
                "Sets internal gains and contaminant rates for occupants in the zone.",
                "If you use a ZoneList in the Zone or ZoneList name field then this definition applies",
                "to all the zones in the ZoneList."
            ],
            "min-fields": [
                "10"
            ]
        }
    },
    "text": "!- Object Set of type People and name -1\n\n\nPeople,\n\tSPACE1-1 People 1,\t\t!- Name\n\tSPACE1-1,\t\t!- Zone or ZoneList Name\n\tOCCUPY-1,\t\t!- Number of People Schedule Name\n\tpeople,\t\t!- Number of People Calculation Method\n\t11,\t\t!- Number of People\n\t,\t\t!- People per Zone Floor Area\n\t,\t\t!- Zone Floor Area per Person\n\t0.3,\t\t!- Fraction Radiant\n\t,\t\t!- Sensible Heat Fraction\n\tActSchd;\t\t!- Activity Level Schedule Name\n\nPeople,\n\tSPACE2-1 People 1,\t\t!- Name\n\tSPACE2-1,\t\t!- Zone or ZoneList Name\n\tOCCUPY-1,\t\t!- Number of People Schedule Name\n\tpeople,\t\t!- Number of People Calculation Method\n\t5,\t\t!- Number of People\n\t,\t\t!- People per Zone Floor Area\n\t,\t\t!- Zone Floor Area per Person\n\t0.3,\t\t!- Fraction Radiant\n\t,\t\t!- Sensible Heat Fraction\n\tActSchd;\t\t!- Activity Level Schedule Name\n\nPeople,\n\tSPACE3-1 People 1,\t\t!- Name\n\tSPACE3-1,\t\t!- Zone or ZoneList Name\n\tOCCUPY-1,\t\t!- Number of People Schedule Name\n\tpeople,\t\t!- Number of People Calculation Method\n\t11,\t\t!- Number of People\n\t,\t\t!- People per Zone Floor Area\n\t,\t\t!- Zone Floor Area per Person\n\t0.3,\t\t!- Fraction Radiant\n\t,\t\t!- Sensible Heat Fraction\n\tActSchd;\t\t!- Activity Level Schedule Name\n\nPeople,\n\tSPACE4-1 People 1,\t\t!- Name\n\tSPACE4-1,\t\t!- Zone or ZoneList Name\n\tOCCUPY-1,\t\t!- Number of People Schedule Name\n\tpeople,\t\t!- Number of People Calculation Method\n\t5,\t\t!- Number of People\n\t,\t\t!- People per Zone Floor Area\n\t,\t\t!- Zone Floor Area per Person\n\t0.3,\t\t!- Fraction Radiant\n\t,\t\t!- Sensible Heat Fraction\n\tActSchd;\t\t!- Activity Level Schedule Name\n\nPeople,\n\tSPACE5-1 People 1,\t\t!- Name\n\tSPACE5-1,\t\t!- Zone or ZoneList Name\n\tOCCUPY-1,\t\t!- Number of People Schedule Name\n\tpeople,\t\t!- Number of People Calculation Method\n\t20,\t\t!- Number of People\n\t,\t\t!- People per Zone Floor Area\n\t,\t\t!- Zone Floor Area per Person\n\t0.3,\t\t!- Fraction Radiant\n\t,\t\t!- Sensible Heat Fraction\n\tActSchd;\t\t!- Activity Level Schedule Name\n",
    "comment": "!- Object Set of type People and name -1\n",
    "objects": [
        {
            "fields": [
                "SPACE1-1 People 1",
                "SPACE1-1",
                "OCCUPY-1",
                "people",
                "11",
                "",
                "",
                "0.3",
                "",
                "ActSchd"
            ],
            "id": "SPACE1-1 People 1",
            "type": "People"
        },
        {
            "fields": [
                "SPACE2-1 People 1",
                "SPACE2-1",
                "OCCUPY-1",
                "people",
                "5",
                "",
                "",
                "0.3",
                "",
                "ActSchd"
            ],
            "id": "SPACE2-1 People 1",
            "type": "People"
        },
        {
            "fields": [
                "SPACE3-1 People 1",
                "SPACE3-1",
                "OCCUPY-1",
                "people",
                "11",
                "",
                "",
                "0.3",
                "",
                "ActSchd"
            ],
            "id": "SPACE3-1 People 1",
            "type": "People"
        },
        {
            "fields": [
                "SPACE4-1 People 1",
                "SPACE4-1",
                "OCCUPY-1",
                "people",
                "5",
                "",
                "",
                "0.3",
                "",
                "ActSchd"
            ],
            "id": "SPACE4-1 People 1",
            "type": "People"
        },
        {
            "fields": [
                "SPACE5-1 People 1",
                "SPACE5-1",
                "OCCUPY-1",
                "people",
                "20",
                "",
                "",
                "0.3",
                "",
                "ActSchd"
            ],
            "id": "SPACE5-1 People 1",
            "type": "People"
        }
    ]
}

Example using curl://

Send the /idf command using curl to retrieve the first People object:

curl -b cookies https://api.ensims.com/jess_web/api/idf/12251/in.idf/People/0

Or if it is a jEPlus project,

curl -b cookies https://api.ensims.com/jess_web/api/idf/12264/EP_0-T_0-W_0-P1_5-P2_0-P3_0-P4_0/in.idf/People/0

To retrieve all People objects in the IDF model:

curl -b cookies https://api.ensims.com/jess_web/api/idf/12251/in.idf/People/-1

On success, the IDF object(s) 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.

Example using Python Requests

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/idf/12251/in.idf/People/0', cookies=cookies)

# Or, if it is a jEPlus project
r = requests.get('https://api.ensims.com/jess_web/api/idf/12264/EP_0-T_0-W_0-P1_5-P2_0-P3_0-P4_0/in.idf/People/0', cookies=cookies)

# Show returned object  
r.json()