Back to top

IoT Real-Time Insights API

Quickstart

This quickstart guide is intended to get you started with the IoT Real-Time Insights API. After you have created a IoT Real-Time Insights Bluemix service instance, either from Bluemix or with the Cloud Foundry CLI, you can use the API to manage your instance.

Note: Should you have any comments or questions on this document, please post a message to the iot-real-time topic on IBM develperWorks Answers.

First create a message source that links to an IoT Platform instance, then create message schemas to describe the message payloads of your devices. You must then create message routes that specify which message schema should be applied to which device type. You can now create rules and actions to apply analytics to your device messages.

Prerequisites

To start using IoT Real-Time Insights you must have a configured and running IoT Platform instance with at least one connected device that is posting messages. See the Getting started with IoT Platform Bluemix documentation for more information on how to get started.

Step 1: Create and bind a Bluemix IoT Real-Time Insights service

Log in to Bluemix. From the Bluemix website you have two options to create a Bluemix IoT Real-Time Insights service instance and bind your application with the instance.

  • Option 1. Go to Catalog > Services > Internet of Things, and select IoT Real-Time Insights. On the IoT Real-Time Insights page, verify the Add Service selections and click CREATE:

    • Space - Verify that you are deploying the service in the same space that you deployed your application and the IoT Platform service.
    • App – Select the application that you want to bind the service to.
    • Service name - Optionally change the service name to something that is easy to remember. This name is displayed in the IoT Real-Time Insights tile in the Bluemix dashboard.
    • Selected plan - Select Lite or a purchase plan that is suitable for your needs.
  • Option 2. Go to the DASHBOARD tab, click your application that you want to bind with an IoT Real-Time Insights instance, then click ADD A SERVICE OR API, locate and click the IoT Real-Time Insights service by searching iot from the search bar or click the Internet of Things checkbox, in the instance creation page your application is already selected automatically, then click CREATE.

For information on using the Cloud Foundry CLI to create and bind IoT Real-Time Insights service, see the Managing Service Instances with the CLI topic in the Cloud Foundry Documentation.

When the service is created, go to your application’s dashboard and click Environment Variables. Locate the IoT Real-Time Insights credentials information in the VCAP_SERVICES tab. Example of credentials information:

{
  "IoT Real-Time Insights": [{
    "name": "iot-rti-gi", 
    "label": "IoT Real-Time Insights", 
    "plan": "Bronze", 
    "credentials": {
      "tenantID": "f6d4737c-4268-422a-bee4-239da4d0e032", 
      "baseUrl": "https://iotrti-prod.mam.ibmserviceengage.com/api/v2", 
      "apiKey": "f6d4737c-4268-422a-bee4-239da4d0e032_0870563d-2a23-473c-992b-f2fe9b86ed85", 
      "authToken": "XWKx9u5v1TjJX02Z6crg28VGj9ARRfQH4KnVUQn5" 
    } 
  }]
}

The most important information here is credentials.baseUrl which specifies the IoT Real-Time Insights API service end-point that your applications should point to. In this guide, whenever you see {baseUrl}, replace it with the value of credentials.baseUrl. All API paths should be appended to this base URL. All the API should be authenticated with the apiKey and authToken.

When the payload of POST/PUT is JSON, add an HTTP header "Content-Type" to "application/json". For example, with curl command you can send your requests with -H 'Content-Type: application/json'.

Step 2: Create a Message Source

Link your IoT Real-Time Insights instance to an IoT Platform organization by creating a message source. The required IoT Platform orgId, apiKey and authToken connection information is also available from your application’s VCAP_SERVICES.

POST {baseUrl}/message/source

{
  "name": "4ji469",
  "orgId": "4ji469",
  "apiKey": "a-4ji469-**********",
  "authToken": "******************",
  "disabled": false
}

Step 3: Create a Message Schema

Message schemas lets IoT Real-Time Insights understand the payload of your device messages:

POST {baseUrl}/message/schema

{
    "name": "Power Usage",
    "format": "JSON",
    "items": [
        {"name": "meterid", "type": "string"},
        {"name": "reading", "type": "float"}
    ]
}

The data points and event types for a device can be found in the IoT Platform dashboard.

  1. Click Launch dashboard to open the IoT Platform dashboard.

  2. Go to the Devices page.

  3. Click your device to open the device details page.

  4. Scroll down to the Sensor Information section to see a list of the available data points for the device.

Step 4: Create Message Route

Message routes specify which message schemas should be applied to specific device types. This lets IoT Real-Time Insights identify the message schema to use when it receives a message for a device.

POST {baseUrl}/message/route

{
  "sourceId": "d22f3389",
  "deviceType": "vehicle",
  "eventType": "+",
  "schemaId": "f1b2b80f"
}

Step 5: Create an Action

Actions are carried out when analytics rules are triggered. Actions are separate entities in Real-Time Insighs and can be reused by multiple rules. Before you create a rule, first create one or more actions.

POST {baseUrl}/action

{
  "type": "node-red",
  "name": "Node-RED Webhook",
  "description": "A webhook for integrating with Node-RED",
  "fields": {
    "url": "http://btnodered.mybluemix.net/rti-webhook"
  }
}
Tip: Remember to escape double quotes if you have some in your JSON values.

Step 6: Create Rule

Rules are used to trigger actions when certain device conditions are met.

Note: If you are subscribing to a Lite plan, rule instances only run for one hour. Restart a rule by setting the `disabled` field to false.

POST {baseUrl}/rule

{
  "name": "Abnormal Power Usage",
  "description": "Abnormal Power Usage when exceeeding 100",
  "disabled": false,
  "severity": 1,
  "schemaId": "f1b2b80f",
  "condition": ".reading > 100",
  "actions": [
    "cc899bdc"
  ]
}

Congratulations!

You have created a IoT Real-Time Insights service, connected it to an IoT Platform instance, configured message schemas and message routing, and created actions and rules. IoT Real-Time Insights is up and running.


API DOC

Authentication

All API calls require HTTP basic-authentication with the username credentials.apiKey and password credentials.authToken. These can be found in the bound Bluemix application’s VCAP_SERVICES.

Message Source

A message source is an equivalent concept to Data Source that is used in the IoT Real-Time Insights web console. Message sources are used to link your IoT Real-Time Insights instance to your IoT Platform organizations. A minimum of one IoT Fondation instance must be linked to use IoT Real-Time Insights.

The message source identifies a specific IoT Platform instance identified by orgID, apiKey, authToken, and enables IoT Real-Time Insights to run analytic processing on device messages sent from the devices that connect to that IoT Platform organization. Each instance of IoT Real-Time Insights can contain multiple message sources, each linking to an IoT Platform instance.

Work with Multiple Message Sources

Get list of message sources
GET/message/source

Retrieve all defined message sources for an IoT Real-Time Insights instance.

Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "id": "d22f3389",
    "name": "4ji469",
    "orgId": "4ji469",
    "apiKey": "a-4ji469-**********",
    "authToken": "******************",
    "disabled": false,
    "created": "2015-10-26T14:03:43Z",
    "updated": "2015-10-26T14:03:43Z"
  }
]
Schema
{
  "type": "array",
  "$schema": "http://json-schema.org/draft-04/schema#"
}

Work with a Single Message Source

Create a message source
POST/message/source

Create a message source. The required IoT Platform orgId, apiKey and authToken information can be retrieved from your application’s VCAP_SERVICES.

Request
HideShow
Headers
Content-Type: application/json
Body
{
  "name": "4ji469",
  "orgId": "4ji469",
  "apiKey": "a-4ji469-**********",
  "authToken": "******************",
  "disabled": false
}
Schema
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Name of the message source."
    },
    "orgId": {
      "type": "string",
      "description": "The organization ID (orgId) of the message source."
    },
    "apiKey": {
      "type": "string",
      "description": "The API Key (apiKey) of the message source."
    },
    "authToken": {
      "type": "string",
      "description": "The API auth token (authToken) of the message source."
    },
    "disabled": {
      "type": "boolean",
      "description": "Whether the message source is disabled, default false."
    }
  },
  "required": [
    "name",
    "orgId",
    "apiKey",
    "authToken"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": "d22f3389",
  "name": "4ji469",
  "orgId": "4ji469",
  "apiKey": "a-4ji469-**********",
  "authToken": "******************",
  "disabled": false,
  "created": "2015-10-26T14:03:43Z",
  "updated": "2015-10-26T14:03:43Z"
}
Schema
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The unique ID of the message source. This is generated when the message source is created."
    },
    "name": {
      "type": "string",
      "description": "Name of the message source."
    },
    "orgId": {
      "type": "string",
      "description": "The organization ID (orgId) of the message source."
    },
    "apiKey": {
      "type": "string",
      "description": "The API Key (apiKey) of the message source."
    },
    "authToken": {
      "type": "string",
      "description": "The API auth token (authToken) of the message source."
    },
    "disabled": {
      "type": "boolean",
      "description": "Whether the message source is disabled, default false."
    },
    "created": {
      "type": "string",
      "description": "ISO8601 date and time of when the message source was created."
    },
    "updated": {
      "type": "string",
      "description": "ISO8601 date and time of when the message source was last updated."
    }
  },
  "required": [
    "id",
    "name",
    "orgId",
    "apiKey",
    "authToken"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}

Get A Message Source
GET/message/source/{id}

Get the message source that is specified by a message source id.

Parameters
HideShow
id
string (required) 

message source ID

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": "d22f3389",
  "name": "4ji469",
  "orgId": "4ji469",
  "apiKey": "a-4ji469-**********",
  "authToken": "******************",
  "disabled": false,
  "created": "2015-10-26T14:03:43Z",
  "updated": "2015-10-26T14:03:43Z"
}
Schema
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The unique ID of the message source. This is generated when the message source is created."
    },
    "name": {
      "type": "string",
      "description": "Name of the message source."
    },
    "orgId": {
      "type": "string",
      "description": "The organization ID (orgId) of the message source."
    },
    "apiKey": {
      "type": "string",
      "description": "The API Key (apiKey) of the message source."
    },
    "authToken": {
      "type": "string",
      "description": "The API auth token (authToken) of the message source."
    },
    "disabled": {
      "type": "boolean",
      "description": "Whether the message source is disabled, default false."
    },
    "created": {
      "type": "string",
      "description": "ISO8601 date and time of when the message source was created."
    },
    "updated": {
      "type": "string",
      "description": "ISO8601 date and time of when the message source was last updated."
    }
  },
  "required": [
    "id",
    "name",
    "orgId",
    "apiKey",
    "authToken"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}

Update a message source
PUT/message/source/{id}

Update the message source that is specified by the message source id.

Parameters
HideShow
id
string (required) 

message source ID

Request
HideShow
Headers
Content-Type: application/json
Body
{
  "name": "4ji469",
  "orgId": "4ji469",
  "apiKey": "a-4ji469-**********",
  "authToken": "******************",
  "disabled": false
}
Schema
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Name of the message source."
    },
    "orgId": {
      "type": "string",
      "description": "The organization ID (orgId) of the message source."
    },
    "apiKey": {
      "type": "string",
      "description": "The API Key (apiKey) of the message source."
    },
    "authToken": {
      "type": "string",
      "description": "The API auth token (authToken) of the message source."
    },
    "disabled": {
      "type": "boolean",
      "description": "Whether the message source is disabled, default false."
    }
  },
  "required": [
    "name",
    "orgId",
    "apiKey",
    "authToken"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": "d22f3389",
  "name": "4ji469",
  "orgId": "4ji469",
  "apiKey": "a-4ji469-**********",
  "authToken": "******************",
  "disabled": false,
  "created": "2015-10-26T14:03:43Z",
  "updated": "2015-10-26T14:03:43Z"
}
Schema
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The unique ID of the message source. This is generated when the message source is created."
    },
    "name": {
      "type": "string",
      "description": "Name of the message source."
    },
    "orgId": {
      "type": "string",
      "description": "The organization ID (orgId) of the message source."
    },
    "apiKey": {
      "type": "string",
      "description": "The API Key (apiKey) of the message source."
    },
    "authToken": {
      "type": "string",
      "description": "The API auth token (authToken) of the message source."
    },
    "disabled": {
      "type": "boolean",
      "description": "Whether the message source is disabled, default false."
    },
    "created": {
      "type": "string",
      "description": "ISO8601 date and time of when the message source was created."
    },
    "updated": {
      "type": "string",
      "description": "ISO8601 date and time of when the message source was last updated."
    }
  },
  "required": [
    "id",
    "name",
    "orgId",
    "apiKey",
    "authToken"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}

Delete a message source
DELETE/message/source/{id}

Delete the message source that is specified by the message source id.

Parameters
HideShow
id
string (required) 

message source ID

Response  204

Message Schema

Message schema is a schema type that lets IoT Real-Time Insights understand the payload of your device messages.

Schema Definition

Schemas are used for parsing incoming messages and contexts so that the system knows what attributes are available and of which types they are. Schemas are needed to define precise and consistent analytic rules on the messages and contexts.

Assuming we have the following message payload:

{
    "meterid": "m1234",
    "customer": {
        "name": {
            "givenName": "John",
            "lastName": "Doe"
        },
        "age": 30
    }
}

We can define the following schema:

{
    "name": "Power Usage",
    "format": "JSON",
    "items": [
        {"name": "meterid", "type": "string"},
        {"name": "customer", "type": "struct", "subItems": [
            {"name": "name", "type": "struct", "subItems": [
                {"name": "givenName", "type": "string"},
                {"name": "lastName", "type": "string"}
            ]},
            {"name": "age", "type": "int"}
        ]},
    ]
}

Parameters:

  1. name (string, required) - The unique name of the schema.

  2. format (string, required) - The format of the payload. Currently only the JSON format is supported.

  3. items (array, required) - The list of items of the schema. The items correspond to the IoT Platform datapoints.

  4. global (boolean, optional, only used for context schema) - Whether this is a global context, default is true.

Each element in the schema’s items array represents one attribute of the content, including the attribute’s name and the data type.

  1. name (string, required) - Name of the attribute, must be unique in a schema.

  2. description (string, optional) - Description of the attribute.

  3. type (string, required) - Any of string, int, float, struct.

  4. key (number, optional, only used for context schema) - The item is (part of) the key for the context schema, and the value (if larger than 0) represents the order of the item in the key, from small to large value. Default is 0. At least one item must have a key larger than 0 because context schema must have a key.

  5. subItems (array, required when type is struct) - When type is struct, defines the next nested level of items.

    • Elements in this array can still be of type struct, allowing defining unlimited nested levels.
Note: There is no automatic data type detection. Each attribute's data type must be correct in order to parse the attribute value correctly.

Work with Multiple Message Schemas

Get list of message schemas
GET/message/schema{?name}

Retrieve the message schema that is specified by the name parameter. If no name parameter is given, all defined message schemas within the IoT Real-Time Insights instance are returned.

Parameters
HideShow
name
string (optional) 

message schema name

Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "id": "f1b2b80f",
    "name": "Power Usage",
    "format": "JSON",
    "items": [
      {
        "name": "meterid",
        "description": "Meter ID",
        "type": "float",
        "subItems": []
      }
    ],
    "created": "2015-10-26T14:03:43Z",
    "updated": "2015-10-26T14:03:43Z"
  }
]
Schema
{
  "type": "array",
  "$schema": "http://json-schema.org/draft-04/schema#"
}

Work with a Single Message Schema

Create a message schema
POST/message/schema

Create a message schema. The data points and event types for a device can be found in the IoT Platform dashboard. See Step 3 of the Quick Start for more information. A message schema id is generated by the system and returned from the response.

Request
HideShow
Headers
Content-Type: application/json
Body
{
  "name": "Power Usage",
  "format": "JSON",
  "items": [
    {
      "name": "meterid",
      "description": "Meter ID",
      "type": "float",
      "subItems": []
    }
  ]
}
Schema
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Name of the message schema. Must be unique in an IoT Real-Time Insights instance."
    },
    "format": {
      "type": "string",
      "enum": [
        "JSON"
      ],
      "description": "The format of the message payload.",
      "default": "JSON"
    },
    "items": {
      "type": "array",
      "description": "The list of items of the message schema."
    }
  },
  "required": [
    "name",
    "format",
    "items"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": "f1b2b80f",
  "name": "Power Usage",
  "format": "JSON",
  "items": [
    {
      "name": "meterid",
      "description": "Meter ID",
      "type": "float",
      "subItems": []
    }
  ],
  "created": "2015-10-26T14:03:43Z",
  "updated": "2015-10-26T14:03:43Z"
}
Schema
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The unique ID of the message schema generated on creation."
    },
    "name": {
      "type": "string",
      "description": "Name of the message schema. Must be unique in an IoT Real-Time Insights instance."
    },
    "format": {
      "type": "string",
      "enum": [
        "JSON"
      ],
      "description": "The format of the message payload.",
      "default": "JSON"
    },
    "items": {
      "type": "array",
      "description": "The list of items of the message schema."
    },
    "created": {
      "type": "string",
      "description": "ISO8601 date and time of when the message schema was created."
    },
    "updated": {
      "type": "string",
      "description": "ISO8601 date and time of when the message schema was last updated."
    }
  },
  "required": [
    "id",
    "name",
    "format",
    "items"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}

Get a message schema
GET/message/schema/{id}

Retrieve the message schema that is specified by the message schema id.

Parameters
HideShow
id
string (required) 

message schema ID

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": "f1b2b80f",
  "name": "Power Usage",
  "format": "JSON",
  "items": [
    {
      "name": "meterid",
      "description": "Meter ID",
      "type": "float",
      "subItems": []
    }
  ],
  "created": "2015-10-26T14:03:43Z",
  "updated": "2015-10-26T14:03:43Z"
}
Schema
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The unique ID of the message schema generated on creation."
    },
    "name": {
      "type": "string",
      "description": "Name of the message schema. Must be unique in an IoT Real-Time Insights instance."
    },
    "format": {
      "type": "string",
      "enum": [
        "JSON"
      ],
      "description": "The format of the message payload.",
      "default": "JSON"
    },
    "items": {
      "type": "array",
      "description": "The list of items of the message schema."
    },
    "created": {
      "type": "string",
      "description": "ISO8601 date and time of when the message schema was created."
    },
    "updated": {
      "type": "string",
      "description": "ISO8601 date and time of when the message schema was last updated."
    }
  },
  "required": [
    "id",
    "name",
    "format",
    "items"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}

Update a message schema
PUT/message/schema/{id}

Update the message schema that is specified by the message schema id.

Parameters
HideShow
id
string (required) 

message schema ID

Request
HideShow
Headers
Content-Type: application/json
Body
{
  "name": "Power Usage",
  "format": "JSON",
  "items": [
    {
      "name": "meterid",
      "description": "Meter ID",
      "type": "float",
      "subItems": []
    }
  ]
}
Schema
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Name of the message schema. Must be unique in an IoT Real-Time Insights instance."
    },
    "format": {
      "type": "string",
      "enum": [
        "JSON"
      ],
      "description": "The format of the message payload.",
      "default": "JSON"
    },
    "items": {
      "type": "array",
      "description": "The list of items of the message schema."
    }
  },
  "required": [
    "name",
    "format",
    "items"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": "f1b2b80f",
  "name": "Power Usage",
  "format": "JSON",
  "items": [
    {
      "name": "meterid",
      "description": "Meter ID",
      "type": "float",
      "subItems": []
    }
  ],
  "created": "2015-10-26T14:03:43Z",
  "updated": "2015-10-26T14:03:43Z"
}
Schema
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The unique ID of the message schema generated on creation."
    },
    "name": {
      "type": "string",
      "description": "Name of the message schema. Must be unique in an IoT Real-Time Insights instance."
    },
    "format": {
      "type": "string",
      "enum": [
        "JSON"
      ],
      "description": "The format of the message payload.",
      "default": "JSON"
    },
    "items": {
      "type": "array",
      "description": "The list of items of the message schema."
    },
    "created": {
      "type": "string",
      "description": "ISO8601 date and time of when the message schema was created."
    },
    "updated": {
      "type": "string",
      "description": "ISO8601 date and time of when the message schema was last updated."
    }
  },
  "required": [
    "id",
    "name",
    "format",
    "items"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}

Delete a message schema
DELETE/message/schema/{id}

Delete the message schema that is specified by the message schema id.

Parameters
HideShow
id
string (required) 

message schema ID

Response  204

Message Route

With message sources and message schemas created, you need to specify which schema should be applied to a specific device type. By creating message routes, you specify the mapping between a message schema and a device type and event type. In most cases, you would want to use a device type to group devices that have the same or a similar message payload structure into the same device type and use a message schema to desribe that payload struture for the device type. By using message routes, IoT Real-Time Insights knows which schema should be used when a message received from a device.

Some devices might send multiple payload structures to IoT Platform under different circustances, and with different event types. In this case, you can create multiple message routes for the same device type but with different event types in order to use different message schemas.

Work with Multiple Message Routes

Get a list of message routes
GET/message/route{?sourceId,schemaId}

Retrieve the message route that is specified by the message source id and message schema id. If no parameters specified all message routes are returned.

Parameters
HideShow
sourceId
string (optional) 

message source ID

schemaId
string (optional) 

message schema ID

Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "id": "d247aa67",
    "sourceId": "d22f3389",
    "deviceType": "vehicle",
    "eventType": "+",
    "schemaId": "f1b2b80f",
    "created": "2015-10-26T14:03:43Z",
    "updated": "2015-10-26T14:03:43Z"
  }
]
Schema
{
  "type": "array",
  "$schema": "http://json-schema.org/draft-04/schema#"
}

Work with a Single Message Route

Add a message route
POST/message/route

Create a message route with the information in the request body. A message route id is generated by the system and returned from the response.

Request
HideShow
Headers
Content-Type: application/json
Body
{
  "sourceId": "d22f3389",
  "deviceType": "vehicle",
  "eventType": "+",
  "schemaId": "f1b2b80f"
}
Schema
{
  "type": "object",
  "properties": {
    "sourceId": {
      "type": "string",
      "description": "The unique ID of a message source of this route."
    },
    "deviceType": {
      "type": "string",
      "description": "The device type from the message source to be included in this route."
    },
    "eventType": {
      "type": "string",
      "description": "The event type from the message source to be included in this route."
    },
    "schemaId": {
      "type": "string",
      "description": "The unique ID of a message schema to be used."
    }
  },
  "required": [
    "sourceId",
    "deviceType",
    "eventType",
    "schemaId"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": "d247aa67",
  "sourceId": "d22f3389",
  "deviceType": "vehicle",
  "eventType": "+",
  "schemaId": "f1b2b80f",
  "created": "2015-10-26T14:03:43Z",
  "updated": "2015-10-26T14:03:43Z"
}
Schema
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The unique ID of the message route."
    },
    "sourceId": {
      "type": "string",
      "description": "The unique ID of a message source of this route."
    },
    "deviceType": {
      "type": "string",
      "description": "The device type from the message source to be included in this route."
    },
    "eventType": {
      "type": "string",
      "description": "The event type from the message source to be included in this route."
    },
    "schemaId": {
      "type": "string",
      "description": "The unique ID of a message schema to be used."
    },
    "created": {
      "type": "string",
      "description": "ISO8601 date and time of when the message route was created."
    },
    "updated": {
      "type": "string",
      "description": "ISO8601 date and time of when the message route was last updated."
    }
  },
  "required": [
    "id",
    "sourceId",
    "deviceType",
    "eventType",
    "schemaId"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}

Delete a message route
DELETE/message/route/{id}

Delete the message route that is specified by the message route id.

Parameters
HideShow
id
string (required) 

message route ID

Response  204

Rule

Rules are used to trigger actions when certain device conditions are met.

Rule Syntax

Rule Condition: A rule condition can simply be a predicate or some conditions joined with binary logical operators.

Binary Logical Operators (in order from highest to lowest precedence):

AND  &&
OR   ||

Predicate: A predicate is an assertion about something expressed with operands joined by comparison operators.

Comparison Operators (in order from highest to lowest precedence):

<    <=   >    >=
=    ==   !=   <>

Operand: An operand could be any valid number, string or attribute from context and message. It can also be a combination of itself joined by arithmetic operators.

Arithmetic Operators (in order from highest to lowest precedence):

*    /    %
+    -

Below are some rule condition examples:

// comparing message attributes with constants
.ax > 1.0
.ay < 0.3
.az == 0.0
.name == ‘device0’

// constants can be left hand side, no restriction
0.3 > .ay

// comparing between message attributes
.ax > .ay

// using multiple predicates with binary logical operators
.ax > 1.0 and .ay < 0.3 or .az == 0.0
.name == ‘device0’ or .id != 1 or .powerusage >= 200.0

// nested message attributes
.d.ax > 1.0 and .d.ay < 0.3 or .d.az == 0.0

// using parentheses
(.d.ax > 1.0 and (.d.ay < 0.3) ) or .d.az == 0.0

// using NOT and parenthese
not (.d.ax > 1.0 and (.d.ay < 0.3) ) or .d.az == 0.0

// arithmetic operators
.d.ax * .d.ax + .d.ay * .d.ay + .d.az * .d.az >= 400.0
(.d.ax + .d.ay + .d.az) / 3 >= 100.0

Work with Multiple Rules

Get a list of rules
GET/rule

Retrieve all the rules that are defined for the IoT Real-Time Insights instance.

Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "id": "a9611ec8",
    "name": "Abnormal Power Usage",
    "description": "Abnormal Power Usage when exceeeding 100",
    "disabled": false,
    "severity": 4,
    "messageSchemas": [],
    "condition": "Power Usage.power > 100",
    "actions": [],
    "created": "2015-10-26T14:03:43Z",
    "updated": "2015-10-26T14:03:43Z"
  }
]
Schema
{
  "type": "array",
  "$schema": "http://json-schema.org/draft-04/schema#"
}

Work with a Single Rule

Create a rule
POST/rule

Create a rule with the information that is defined in the request body. A rule id is generated by the system and returned in the response.

Request
HideShow
Headers
Content-Type: application/json
Body
{
  "name": "Abnormal Power Usage",
  "description": "Abnormal Power Usage when exceeeding 100",
  "disabled": false,
  "severity": 4,
  "messageSchemas": [],
  "condition": "Power Usage.power > 100",
  "actions": []
}
Schema
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Name of the rule."
    },
    "description": {
      "type": "string",
      "description": "Description of the rule."
    },
    "disabled": {
      "type": "boolean",
      "description": "Whether the rule is disabled, default false."
    },
    "severity": {
      "type": "number",
      "enum": [
        4,
        3,
        2,
        1
      ],
      "description": "Severity of the rule, smaller number means higher priority, default is 4 (low severity).",
      "default": 4
    },
    "messageSchemas": {
      "type": "array",
      "description": "The the message schema IDs used by the rule."
    },
    "condition": {
      "type": "string",
      "description": "Condition of the rule, prefix each attribute with schema name."
    },
    "actions": {
      "type": "array",
      "description": "The unique IDs of actions to be taken by the rule, default empty."
    }
  },
  "required": [
    "name",
    "messageSchemas",
    "condition"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": "a9611ec8",
  "name": "Abnormal Power Usage",
  "description": "Abnormal Power Usage when exceeeding 100",
  "disabled": false,
  "severity": 4,
  "messageSchemas": [],
  "condition": "Power Usage.power > 100",
  "actions": [],
  "created": "2015-10-26T14:03:43Z",
  "updated": "2015-10-26T14:03:43Z"
}
Schema
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The unique ID of the rule."
    },
    "name": {
      "type": "string",
      "description": "Name of the rule."
    },
    "description": {
      "type": "string",
      "description": "Description of the rule."
    },
    "disabled": {
      "type": "boolean",
      "description": "Whether the rule is disabled, default false."
    },
    "severity": {
      "type": "number",
      "enum": [
        4,
        3,
        2,
        1
      ],
      "description": "Severity of the rule, smaller number means higher priority, default is 4 (low severity).",
      "default": 4
    },
    "messageSchemas": {
      "type": "array",
      "description": "The the message schema IDs used by the rule."
    },
    "condition": {
      "type": "string",
      "description": "Condition of the rule, prefix each attribute with schema name."
    },
    "actions": {
      "type": "array",
      "description": "The unique IDs of actions to be taken by the rule, default empty."
    },
    "created": {
      "type": "string",
      "description": "ISO8601 date and time of when the rule was created."
    },
    "updated": {
      "type": "string",
      "description": "ISO8601 date and time of when the rule was last updated."
    }
  },
  "required": [
    "name",
    "messageSchemas",
    "condition"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}

Get a rule
GET/rule/{id}

Retrieve the rule that is specified by the rule id.

Parameters
HideShow
id
string (required) 

rule ID

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": "a9611ec8",
  "name": "Abnormal Power Usage",
  "description": "Abnormal Power Usage when exceeeding 100",
  "disabled": false,
  "severity": 4,
  "messageSchemas": [],
  "condition": "Power Usage.power > 100",
  "actions": [],
  "created": "2015-10-26T14:03:43Z",
  "updated": "2015-10-26T14:03:43Z"
}
Schema
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The unique ID of the rule."
    },
    "name": {
      "type": "string",
      "description": "Name of the rule."
    },
    "description": {
      "type": "string",
      "description": "Description of the rule."
    },
    "disabled": {
      "type": "boolean",
      "description": "Whether the rule is disabled, default false."
    },
    "severity": {
      "type": "number",
      "enum": [
        4,
        3,
        2,
        1
      ],
      "description": "Severity of the rule, smaller number means higher priority, default is 4 (low severity).",
      "default": 4
    },
    "messageSchemas": {
      "type": "array",
      "description": "The the message schema IDs used by the rule."
    },
    "condition": {
      "type": "string",
      "description": "Condition of the rule, prefix each attribute with schema name."
    },
    "actions": {
      "type": "array",
      "description": "The unique IDs of actions to be taken by the rule, default empty."
    },
    "created": {
      "type": "string",
      "description": "ISO8601 date and time of when the rule was created."
    },
    "updated": {
      "type": "string",
      "description": "ISO8601 date and time of when the rule was last updated."
    }
  },
  "required": [
    "name",
    "messageSchemas",
    "condition"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}

Update a rule
PUT/rule/{id}

Update the rule that is specified by the rule id and the request body.

Parameters
HideShow
id
string (required) 

rule ID

Request
HideShow
Headers
Content-Type: application/json
Body
{
  "name": "Abnormal Power Usage",
  "description": "Abnormal Power Usage when exceeeding 100",
  "disabled": false,
  "severity": 4,
  "messageSchemas": [],
  "condition": "Power Usage.power > 100",
  "actions": []
}
Schema
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Name of the rule."
    },
    "description": {
      "type": "string",
      "description": "Description of the rule."
    },
    "disabled": {
      "type": "boolean",
      "description": "Whether the rule is disabled, default false."
    },
    "severity": {
      "type": "number",
      "enum": [
        4,
        3,
        2,
        1
      ],
      "description": "Severity of the rule, smaller number means higher priority, default is 4 (low severity).",
      "default": 4
    },
    "messageSchemas": {
      "type": "array",
      "description": "The the message schema IDs used by the rule."
    },
    "condition": {
      "type": "string",
      "description": "Condition of the rule, prefix each attribute with schema name."
    },
    "actions": {
      "type": "array",
      "description": "The unique IDs of actions to be taken by the rule, default empty."
    }
  },
  "required": [
    "name",
    "messageSchemas",
    "condition"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": "a9611ec8",
  "name": "Abnormal Power Usage",
  "description": "Abnormal Power Usage when exceeeding 100",
  "disabled": false,
  "severity": 4,
  "messageSchemas": [],
  "condition": "Power Usage.power > 100",
  "actions": [],
  "created": "2015-10-26T14:03:43Z",
  "updated": "2015-10-26T14:03:43Z"
}
Schema
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The unique ID of the rule."
    },
    "name": {
      "type": "string",
      "description": "Name of the rule."
    },
    "description": {
      "type": "string",
      "description": "Description of the rule."
    },
    "disabled": {
      "type": "boolean",
      "description": "Whether the rule is disabled, default false."
    },
    "severity": {
      "type": "number",
      "enum": [
        4,
        3,
        2,
        1
      ],
      "description": "Severity of the rule, smaller number means higher priority, default is 4 (low severity).",
      "default": 4
    },
    "messageSchemas": {
      "type": "array",
      "description": "The the message schema IDs used by the rule."
    },
    "condition": {
      "type": "string",
      "description": "Condition of the rule, prefix each attribute with schema name."
    },
    "actions": {
      "type": "array",
      "description": "The unique IDs of actions to be taken by the rule, default empty."
    },
    "created": {
      "type": "string",
      "description": "ISO8601 date and time of when the rule was created."
    },
    "updated": {
      "type": "string",
      "description": "ISO8601 date and time of when the rule was last updated."
    }
  },
  "required": [
    "name",
    "messageSchemas",
    "condition"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}

Delete a rule
DELETE/rule/{id}

Delete the rule that is specified by the rule id.

Parameters
HideShow
id
string (required) 

rule ID

Response  204

Action

Actions let you define what should happen when rules are triggered by rules. In addition to the internal alert that is created you can add one or more actions of different types.

Action Types

mail

This action sends an email when a rule is triggered.

Below is an example payload to create a mail action:

{
  "type": "mail",
  "name": "email action",
  "description": "Sending email when a rule is triggered.",
  "fields": {
    "to": "john@ibm.com,jane@ibm.com",
    "cc": "michael@ibm.com",
    "subject": "IoT Real-Time Insights alert: Abnormal Power Usage",
    "subjectPrefix": false,
    "includeDeviceData": false
  }
}

Parameters:

  • to (string, required) - Comma separated email addresses.

  • cc (string, optional) - Comma separated email addresses, defaut is empty.

  • subject (string, optional) - The email subject, default is "IoT Real-Time Insights alert: " appended with the rule’s name.

  • subjectPrefix (boolean, optional, only used when subject is given) - Whether to prefix the email subject with "IoT Real-Time Insights alert: ", defualt is false.

  • includeDeviceData (boolean, optional) - Whether to include the original message content from the device in the email body, default is false.

Note: For now, the email content is fixed and cannot be customized. However, you can set the option 'includeDeviceData' to false to exclude the device data from the email body.

webhook

This action sends a request to a webhook end-point when a rule is triggered. Each time a rule is triggered, the webhook end-point gets called once. All of the webhook end-point URL, HTTP headers, and the body content can use variable substitution to include additional device message and rule information.

Below is an example payload to create a webhook action:

{
  "type": "webhook",
  "name": "webhook action",
  "description": "webhook integration action",
  "fields": {
    "url": "http://ibm.com/api/tenant/{{tenantId}}/device/{{deviceId}}?key1=value1&key2=value2",
    "method": "POST",
    "username": "",
    "password": "",
    "headers": "{\"header1\":\"value1\",\"header2\":\"value2\"}",
    "contentType": "application/json",
    "body": "{\"rule\":\"{{ruleName}}\",\"condition\":\"{{ruleCondition}}\",\"message\":\"{{message}}\"}"
  }
}

Parameters:

  • url (string, required) - A valid URL accessible on the internet from our system.

    • Variable substitution can be used (see below for the allowed variables).
    • Query strings with variable substitution are also supported.
  • method (string, required) - Any of GET/HEAD/PATCH/PUT/POST/DELETE, case-insensitive.

  • username/password (string, optional) - Use HTTP basic authentication, default is empty.

    • Both must be given, otherwise no authentication is performed.
  • contentType (string, optional, only applicable when method is neither GET nor HEAD) - Custom HTTP header Content-Type, default is text/plain.

    • Only allow one of application/json, application/xml, application/x-www-form-urlencoded, or text/plain, case-insensitive.
  • headers (string, optional) - Custom HTTP headers to use, default is empty.

    • A stringified JSON object with key/value pairs, each pair representing one header.
    • Value in the JSON object can be of any type, which would be converted to string (by toString()).
    • If contentType is given, header with key Content-Type given here is ignored.
    • Variable substitution can be used (see below for the allowed variables).
  • body (string, optional, only applicable when method is neither GET nor HEAD) - default is empty.

    • No validation is performed on body content, it is clien’t responsibility to make sure the body content conforms to the given contenType.
    • When contentType is application/json, it should be a valid strigified JSON.
    • When contentType is application/x-www-form-urlencoded, it should conform HTML4, ex. MyVariableOne=ValueOne&MyVariableTwo=ValueTwo
    • Variable substitution can be used (see below for the allowed variables).

The following variables can be used in url/headers/body, wrap them with double braces, like {{timestamp}}:

  • timestamp - The time the original message from the device was received (our system time).

  • tenantId - The instance ID of IoT Real-Time Insights Bluemix service.

  • deviceId - Full device ID, in the format of org:type:id.

  • ruleName - The name of the rule triggered the alert.

  • ruleDescription (only available in body) - The description of the rule triggered the alert.

  • ruleCondition (only available in body) - The condition of the rule triggered the alert.

  • message (only available in body) - The original message from the device.

node-red

This action sends a request to a Node-RED HTTP input node when a rule is triggered. It is a webhook specifically for integrating with Node-RED.

Below is an example payload to create a node-red action:

{
  "type": "node-red",
  "name": "Node-RED",
  "description": "Node-RED integration",
  "fields": {
    "url": "http://btnodered.mybluemix.net/rti-webhook"
  }
}

Only one paramter is required: the URL of the target Node-RED HTTP input node. The target Node-RED needs to be configured with an HTTP input node, with method “POST” and an URL path. Assuming you set an URL path /rti-webhook to the Node-RED HTTP input node and your target Node-RED is at http://btnodered.mybluemix.net, then you should use the following value for the parameter url:

http://btnodered.mybluemix.net/rti-webhook

The body posted to Node-RED is in JSON, containing all webhook variables (see webhook section above for all variable names).

ifttt

This action sends a webhook specifically for integrating with IFTTT.

The IFTTT Maker channel is used to enable this action. You need to have an IFTTT account first. Then enable your account’s Maker channel to get your key credential.

Below is an example payload to create an ifttt action:

{
  "type": "ifttt",
  "name": "IFTTT",
  "description": "IFTTT integration",
  "fields": {
    "key": "************",
    "event": "rti",
    "value1": "{{deviceId}}",
    "value2": "{{ruleDescription}} ({{ruleCondition}})",
    "value3": "{{message}}"
  }
}

Parameters:

  • key (string, required) - IFTTT credential which can be retrieved from here.

  • event (string, required) - IFTTT Maker channel trigger’s event name. You can create multiple recipes wih different triggers, each with a different event name.

  • value1, value2, value3 (string, optional) - You can use any content in these 3 parameters, which will be passed on to the action in your IFTTT recipes, default are empty.

IFTTT Maker channel only allows using up to 3 fields (value1, value2, and value3).

Actions

Get a list of actions
GET/action{?type}

Retrieve a list of action of the specified type. All defined actions are returned if no type parameter specified.

Parameters
HideShow
type
string (optional) 

action type

Choices: webhook node-red ifttt mail

Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "id": "cc899bdc",
    "type": "webhook",
    "name": "Node-RED Webhook",
    "description": "A webhook for integrating with Node-RED",
    "fields": {},
    "created": "2015-10-26T14:03:43Z",
    "updated": "2015-10-26T14:03:43Z"
  }
]
Schema
{
  "type": "array",
  "$schema": "http://json-schema.org/draft-04/schema#"
}

Work with a Single Action

Create an action
POST/action

Create an action with the information that is defined in the request body. An action id is generated by the system and returned from the response.

Request
HideShow
Headers
Content-Type: application/json
Body
{
  "type": "webhook",
  "name": "Node-RED Webhook",
  "description": "A webhook for integrating with Node-RED",
  "fields": {}
}
Schema
{
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "enum": [
        "webhook",
        "node-red",
        "ifttt",
        "mail"
      ],
      "description": "The type of the action."
    },
    "name": {
      "type": "string",
      "description": "The name of the action."
    },
    "description": {
      "type": "string",
      "description": "The description of the action."
    },
    "fields": {
      "type": "object",
      "description": "The fields of the action. The exact structure depends on type."
    }
  },
  "required": [
    "type",
    "name",
    "fields"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": "cc899bdc",
  "type": "webhook",
  "name": "Node-RED Webhook",
  "description": "A webhook for integrating with Node-RED",
  "fields": {},
  "created": "2015-10-26T14:03:43Z",
  "updated": "2015-10-26T14:03:43Z"
}
Schema
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The unique ID of the action."
    },
    "type": {
      "type": "string",
      "enum": [
        "webhook",
        "node-red",
        "ifttt",
        "mail"
      ],
      "description": "The type of the action."
    },
    "name": {
      "type": "string",
      "description": "The name of the action."
    },
    "description": {
      "type": "string",
      "description": "The description of the action."
    },
    "fields": {
      "type": "object",
      "description": "The fields of the action. The exact structure depends on type."
    },
    "created": {
      "type": "string",
      "description": "ISO8601 date and time of when the action was created."
    },
    "updated": {
      "type": "string",
      "description": "ISO8601 date and time of when the action was last updated."
    }
  },
  "required": [
    "type",
    "name",
    "fields"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}

Get an action
GET/action/{id}

Retrieve the action that is specified by the action id.

Parameters
HideShow
id
string (required) 

action ID

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": "cc899bdc",
  "type": "webhook",
  "name": "Node-RED Webhook",
  "description": "A webhook for integrating with Node-RED",
  "fields": {},
  "created": "2015-10-26T14:03:43Z",
  "updated": "2015-10-26T14:03:43Z"
}
Schema
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The unique ID of the action."
    },
    "type": {
      "type": "string",
      "enum": [
        "webhook",
        "node-red",
        "ifttt",
        "mail"
      ],
      "description": "The type of the action."
    },
    "name": {
      "type": "string",
      "description": "The name of the action."
    },
    "description": {
      "type": "string",
      "description": "The description of the action."
    },
    "fields": {
      "type": "object",
      "description": "The fields of the action. The exact structure depends on type."
    },
    "created": {
      "type": "string",
      "description": "ISO8601 date and time of when the action was created."
    },
    "updated": {
      "type": "string",
      "description": "ISO8601 date and time of when the action was last updated."
    }
  },
  "required": [
    "type",
    "name",
    "fields"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}

Update an action
PUT/action/{id}

Update the action that is specified by the action id and the request body.

Parameters
HideShow
id
string (required) 

action ID

Request
HideShow
Headers
Content-Type: application/json
Body
{
  "type": "webhook",
  "name": "Node-RED Webhook",
  "description": "A webhook for integrating with Node-RED",
  "fields": {}
}
Schema
{
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "enum": [
        "webhook",
        "node-red",
        "ifttt",
        "mail"
      ],
      "description": "The type of the action."
    },
    "name": {
      "type": "string",
      "description": "The name of the action."
    },
    "description": {
      "type": "string",
      "description": "The description of the action."
    },
    "fields": {
      "type": "object",
      "description": "The fields of the action. The exact structure depends on type."
    }
  },
  "required": [
    "type",
    "name",
    "fields"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": "cc899bdc",
  "type": "webhook",
  "name": "Node-RED Webhook",
  "description": "A webhook for integrating with Node-RED",
  "fields": {},
  "created": "2015-10-26T14:03:43Z",
  "updated": "2015-10-26T14:03:43Z"
}
Schema
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The unique ID of the action."
    },
    "type": {
      "type": "string",
      "enum": [
        "webhook",
        "node-red",
        "ifttt",
        "mail"
      ],
      "description": "The type of the action."
    },
    "name": {
      "type": "string",
      "description": "The name of the action."
    },
    "description": {
      "type": "string",
      "description": "The description of the action."
    },
    "fields": {
      "type": "object",
      "description": "The fields of the action. The exact structure depends on type."
    },
    "created": {
      "type": "string",
      "description": "ISO8601 date and time of when the action was created."
    },
    "updated": {
      "type": "string",
      "description": "ISO8601 date and time of when the action was last updated."
    }
  },
  "required": [
    "type",
    "name",
    "fields"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}

Delete an action
DELETE/action/{id}

Delete the action that is specified by the action id.

Parameters
HideShow
id
string (required) 

action ID

Response  204

Alert

Alerts are the IoT Real-Time Insights internal indicators that a rule has been triggered. Alerts are independent of actions. A rule does not require an action but a triggered rule will always result in an alert.

Work with Multiple Alerts

Get a list of alerts
GET/alert{?deviceId,ruleId,top,order,start,end}

You can get a list of alerts that you are interested in by specifing the parameters. Note that the given parameters are treated with AND logic, which means only records that match all of them are returned.

Important: All the parameters must be matched for the records to be returned.

Parameters
HideShow
deviceId
string (required) 

device ID.

ruleId
string (optional) 

rule ID.

start
number (optional) 

start time, inclusive, in milliseconds since January 1, 1970, 00:00:00 GMT.

end
number (optional) 

end time, exclusive, in milliseconds since January 1, 1970, 00:00:00 GMT.

top
number (optional) 

the maximum number of the records returned, default is 100.

order
string (optional) Default: desc 

the sort order, in time, of the records returned.

Choices: desc asc

Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "schema_name": "h_kone",
    "event_time": "2015-09-16 05:04:03.826",
    "tenant_id": "c7d78610-7abb-47df-8bbb-3d634727bd03",
    "device_id": "fvu20d:tify-simu:Device0001",
    "kid": "b999d4e3-32e6-4105-b245-40a8b18d809f",
    "rule_name": "rule1",
    "rule_message_schema": "h_kone",
    "rule_condition": "((.doc.payload.gyro_x >= .doc.payload.compass_y ) AND .doc.payload.acc_z <= 30 ) OR (.doc.payload.air_pressure != 100 AND .doc.payload.ambient_temp > .doc.payload.object_temp)",
    "rule_destination": "tenant.c7d78610-7abb-47df-8bbb-3d634727bd03.ruleOutput",
    "read_flag": {
      "baseType": 12,
      "primitiveType": false,
      "baseTypeName": "VARCHAR",
      "dimensions": 1,
      "array": [
        "userId1"
      ]
    }
  }
]

Generated by aglio on 11 Mar 2016