Standards

Intelligent Environments is a REST architecture, and is therefore constrained by Hypermedia as the Engine of Application State HATEOAS.

As defined by the query parameters, the Intelligent Environments APIs use "search" functions to access raw data using HTTPS, and"live" functions to request a WebSocket for receiving near real-time data from any active sensor.

Links can be found beneath _links in the response. Responses are in JSON format.

IMPORTANT: Do not create your own URIs. Instead, use the links in this document and in the responses to navigate between resources.

Example 1: How to drill down in HATEOAS using the GET ASSETS or GET LOCATIONS APIs.
Note:

To subscribe to different event-types or location-types, you will have to subscribe to different tiles. See https://Predix.IO/catalog.

  1. Option to start with Get All Assets or Get All Locations
  2. Option to Get Events (PULL) or Push Events (PUSH/STREAM)
    • Pull Events
      https://<ie-traffic-url>/v1/assets/<asset-ID>/events?event-types=<event-type>&start-ts=1460658039415&end-ts=1460744439414&size=10
    • Push Event (PUSH/STREAM)
      https://<ies-dev-url>/v1/assets/<asset-Id>/live-events?event-types=<eventtype1>,<eventtype2>
    Note: To get the event streaming, you need to retrieve the URI in the Pull event.
Example 2: How to use HATEOAS - the seed app provides sample code.
<iron-ajax auto id="idInitCall" url="[[baseUrl]]" handle-as="json" on-response="_handleInitResponse">
    </iron-ajax>
    <iron-ajax auto url="[[dataSourceUrl]]" handle-as="json" on-response="_handleDataSourceResponse">
    </iron-ajax>
    <iron-ajax auto id="idSearchApiCall" url="[[searchUrl]]" timeout="[[timeoutMilliseconds]]" \
        on-error="_handleApiCallError" handle-as="json" params=[[_searchApiParams]] on-response="_handleSearchEventResponse">
    </iron-ajax>
    <iron-ajax auto id="idTrafficDataApiCall" url="[[trafficDataApiUrl]]" handle-as="json" params=[[_params]] timeout="[[timeoutMilliseconds]]" 
        on-error="_handleApiCallError" on-request="_handleTrafficDataRequest" on-response="_handleTrafficDataResponse">
    </iron-ajax>