IoT Stadium

API Documentation

Automation

Automation - Add Telemetry Trigger

Add the telemetry trigger for your automation

Post
https://api.iotstadium.com/auth/ext/automations

Parameter

Field Type Description
triggers Array

Contains the detail about the triggers for your new automation

triggers.*.device Text

The ID of your selected device

triggers.*.source Text

The source of your new trigger

triggers.*.value Array

Contains the selected telemetry key and its name

triggers.*.value.*.telemetry_key Text

The telemetry key of your selected telemetry

triggers.*.value.*.key_wording Text

The name of your selected telemetry

triggers.*.condition Text

To set the operator related to threshold value

triggers.*.comparator Text

The value of the threshold limit that you set for the trigger

triggers.*.relation Text

The relation you set, in case if you have more than one trigger

actions Array

Contains the detail about the action of your new automation

actions.*.type Text

The action type of your alarm (Alarm)

actions.*.detail Array

The detail about your selected action type

actions.*.detail.*.alarm Array

Contain the further detail about the alarm action

actions.*.detail.*.alarm.*.is_send_email Text

The condition if the alarm triggered, you need to send the email or not

actions.*.detail.*.alarm.*.alarm_email Text

The email recipient will be notified when the alarm is triggered.

actions.*.detail.*.alarm.*.device Text

The ID of the selected device which will execute the action

actions.*.detail.*.alarm.*.detail Text

The notification description about the action

actions.*.detail.*.alarm.*.alarm_email_group_id Text

The ID of the email group that will be notified

actions.*.type Text

The action type of your alarm (Controller)

actions.*.detail Array

The detail about your selected action type

actions.*.detail.*.controller Array

Contain further detail about the controller action

actions.*.detail.*.controller.*.device Number

The ID of the selected device to execute the action

actions.*.detail.*.controller.*.device_action_key Text

The key for the action of the selected device

actions.*.detail.*.controller.*.device_action_value Text

The value for the action of the selected device

actions.*.type Text

The action type of your alarm (Send Email)

actions.*.detail Array

The detail about your selected action type

actions.*.detail.*.email Array

Contain further detail about the sending email action

actions.*.detail.*.email.*.to Text

The email recipient

actions.*.detail.*.email.*.subject Text

The email's subject

actions.*.detail.*.email.*.content Text

The email's content section

actions.*.detail.*.email.*.email_group_id Number

The ID of the email group that will be notified

actions.*.type Text

The action type of your alarm (Call REST API)

actions.*.detail Array

The detail about your selected action type

actions.*.detail.*.api Array

Contain further detail about the API action

actions.*.detail.*.api.*.url Text

The URL API

actions.*.detail.*.api.*.method Text

The API request method

actions.*.detail.*.api.*.headers Array

The API headers

actions.*.detail.*.api.*.headers.*.key Text

The key of API headers

actions.*.detail.*.api.*.headers.*.value Text

The value of API headers

actions.*.detail.*.api.*.params Array

The API params

actions.*.detail.*.api.*.params.*.key Text

The key of API params

actions.*.detail.*.api.*.params.*.value Text

The value of API params

actions.*.detail.*.api.*.body Text

The API body

name Text

The name for your new telemetry trigger automation

is_active Number

The condition of your automation

automation_type Text

The automation type that you select

automation_interval Number

The interval time of the automation you created

description Text

Description of the new automation

automation_delay Number

The delay value of the new automation

automation_deadband Text

The deadband of the new automation

{
    "message": "automation created",
    "data": {
        "id": 985
    },
    "code": 200
}
{
    "message": "Invalid Message",
    "code": 400,
    "errors": [
        {
            "field": "actions.0.detail.alarm.alarm_email",
            "message": "The actions.0.detail.alarm.alarm_email field is required when actions.0.detail.alarm.is_send_email is 1."
        },
        {
            "field": "actions.2.detail.email.to",
            "message": "The actions.2.detail.email.to field is required when actions.2.type is email."
        }
    ]
}