Enterprise Environment

The Enterprise Environment API supports the following services to access data:

  1. WebSocket Service
    1. Receive near real-time event data for an asset
    2. Receive near real-time event data for assets in a location
  2. REST Service
    1. Retrieve near real-time event data for an asset
    2. Receive near real-time event data for assets in a location
    3. Retrieve historical event data for an asset
    4. Retrieve historical event data for assets in a location

Websocket Service

Use the Websocket Service to retrieve near real-time event data for an asset and assets in a location.

a – Retrieve near real-time event data for an asset

WebSocket URI wss://<production url>/events
JSON Request Format {“assetUid":"<assetUID>","eventTypes":["<eventType1>”,"<eventType2>”,…]}
SAMPLE JSON Request: {“assetUid":"Sensor1_150_200","eventTypes":["OCCUPANCY”]}

JSON Request Parameters

Parameter Description Required? Filter Values
assetUid GE identifier for a sensor Yes Value such as "Sensor1_150_200".

eventTypes

Filter for environment events

Yes

Insert the following enumeration codes to receive environment sensor data:

  • CO2 – Receive carbon dioxide measurement data
  • HUMIDITY – Receive relative humidity measurement data
  • LIGHT_LEVEL – Receive ambient light measurement data
  • OCCUPANCY – Receive occupancy measurement data
  • TEMP – Receive ambient temperature data
analyticCategory For both Dwell Time by Zone and Dwell Time by Device, the dwell time. Yes A String, such as DWELL_TIME.
start-ts Start time in milliseconds. Yes Numerical value, such as 1459148400000.
end-ts End time in milliseconds. Yes Numerical value, such as 1459212163672.

b - Receive near real-time event data for assets in a location

WebSocket URI wss://<production url>/events
JSON Request Format {“locationUid":"<locationUID>","eventTypes":["<eventType1>,<eventType2>"]}
Sample JSON Request {“locationUid":"LOCATION-282","eventTypes":["OCCUPANCY”]}

JSON Request Parameters

Parameter Description Required? Filter Values
locationUid GE Identifier for a location Yes Value such as "LOCATION-282".
eventTypes filter for Environments Yes See the enumeration codes for eventTypes in the Glossary for Intelligent Enterprises.

Sample Response

{
                "content": [
                  {
                    "locationUid": “LOCATION-282”,
                    "assetUid": "Sensor1_150_200",
                    "eventType": "OCCUPANCY",
                    "timestamp": 1477825825769,
                    "properties": {
                    "Unit": "BOOLEAN",
                    "Name": "OCCUPANCY"
                },
                "measures": {
                "Value": 1
                     }
                   }
                 ]
                }
       

JSON Response Parameters

Parameter Data Type Description
locationUid String Unique, customer-defined identifier for a specific location
assetUid String The customer-defined identifier for a specific asset
eventTypes String See the enumeration codes for eventTypes in the Glossary for Intelligent Enterprises.
timestamp Number Actual timestamp when event occurred. Timestamps are in EPOCH format (milliseconds).
properties N/A Custom properties captured for this event type.
...Unit String Event type unit of measurement
...Name String Event type name
Measures N/A Event type measurement data
...Value Number Event data value

REST Service

Use the REST URIs to retrieve near real-time and historic event data.

a – Retrieve near real-time event data for an asset

Method GET
URI <production url>/enterprise/environment/assets/<assetUid>/ latestEvent?eventType=<eventType>
Sample URI <production url>/enterprise/environment/assets/Sensor1_150_200/latestEvent?eventType=OCCUPANCY

Query Parameters

Parameter Description Required? Filter Values
assetUid GE Identifier for a sensor Yes Value such as "Sensor1_150_200".
latestEvent? Query for near real-time event data Yes

eventType

eventTypes

Filter for environment event

Yes See the enumeration codes for eventTypes in the Glossary for Intelligent Enterprises.

b – Retrieve near real-time event data for assets in a location

Method GET
URI <production url>/enterprise/environment/locations/<locationUid>/ latestEvent?eventType=<eventType>
Sample URI <production url>/enterprise/environment/locations/LOCATION-282/ latestEvent?eventType=OCCUPANCY

Query Parameters

Parameter Description Required? Filter Values
locationUid GE Identifier for a location Yes Value such as "LOCATION-282".
latestEvent? Query for near real-time event data Yes eventType
eventTypes Filter for environment event Yes See the enumeration codes for eventTypes in the Glossary for Intelligent Enterprises.

c – Retrieve historical event data for an asset

METHOD GET
URI

<production url>/enterprise/environment/assets/<assetUid>/ events?eventType=<eventType>&startTime=1472367600000&endTime=1472497900538

Sample URI

<production url>/enterprise/environment/assets/Sensor1_150_200/

events?eventType=OCCUPANCY&startTime=1472367600000

&endTime=1472497900538

Query Parameters

Parameter Description Required? Filter Values
assetUid GE identifier for a sensor Yes Value such as "Sensor1_150_200".
events? Query for historical event data Yes eventType
eventTypes Filter for environment event Yes See the enumeration codes for eventTypes in the Glossary for Intelligent Enterprises.
startTime Start time (timestamp) recorded in EPOCH format (milliseconds). Yes

Numerical value, such as

1453766605577.
endTime Start time (timestamp) recorded in EPOCH format (milliseconds). Yes

Numerical value, such as

1453766605577.

d-Retrieve historical event data for assets in a location

METHOD GET
URI

<production url>/enterprise/environment/locations/<locationUid>/events?eventType=<eventType>&startTime=1472367600000&endTime=1472497900538

Sample URI

<production url>/enterprise/environment/locations/LOCATION-282/ events?eventType=OCCUPANCY&startTime=1472367600000&endTime=1472497900538

Query Parameters

Parameter Description Required? Filter Values
locationUid GE identifier for a location Yes Value such as "LOCATION-282".
events? Query for historical event data Yes Insert the following enumeration codes to receive environment sensor data:
  • CO2 – Carbon dioxide measurement data
  • HUMIDITY – Relative humidity measurement data
  • LIGHT_LEVEL – Ambient light measurement data
  • OCCUPANCY – Occupancy measurement data
  • TEMP – Ambient temperature data
startTime Start time (timestamp) recorded in EPOCH format (milliseconds). Yes

Numerical value, such as

1453766605577.
endTime Start time (timestamp) recorded in EPOCH format (milliseconds). Yes

Numerical value, such as

1453766605577.

Sample Response

{
                "content": [
                  {
                    "locationUid": “LOCATION-282”,
                    "assetUid": "Sensor1_150_200",
                    "eventType": "OCCUPANCY",
                    "timestamp": 1477825825769,
                    "properties": {
                    "Unit": "BOOLEAN",
                    "Name": "OCCUPANCY"
                },
                "measures": {
                "Value": 1
                    }
                   }
                 ]
                }
                 

JSON Response Parameters

Parameter Data Type Description
locationUid String Unique, customer-defined identifier for a specific location
assetUid String The customer-defined identifier for a specific asset
eventTypes String See the enumeration codes for eventTypes in the Glossary for Intelligent Enterprises.
timeStamp Number Actual timestamp when event occurred. Timestamps are in EPOCH format (milliseconds).
properties N/A Custom properties captured for this event type.
...Unit String Event type unit of measurement
...Name String Event type name
Measures N/A Event type measurement data
...Value Number Event data value