API.Devices

  • The request for device types
  • The request for groups of types
  • The request on available fields for specific device
  • The request for list all available devices
  • The request on create device
  • The request on remove device
  • The request on restore device
  • The request for device messages

/api.devices.types

Get types of devices

Is called without parameters.

In the case of a successful response will return a json object:

[
    {
        "id": 0, // (Integer `10`) The internal type ID of Telemetric.app
        "deviceTypeID": 0, // (Integer `11`) The internal type ID of Telemetric.app for protocol used
        "title": "", // (String `255`) A name of device type
        "keyAp": "", // (String `64` or null) Application session key
        "keyNw": "", // (String `64` or null) Network session key
        "group_id": 0, // (Integer `10`) The link on group type
        "amount_inputs": 0, // (Tinyint `3`) The amount of inputs
        "amount_outputs": 0, // (Tinyint `3`) The amount of outputs
        "_232": 0, // (Tinyint `1`) A sign of the presence of the entrance 232
        "_485": 0, // (Tinyint `1`) A sign of the presence of the entrance 485
        "report_period_update": 0, // (Integer `6`) The collection period of this type of device
        "report_online_settings": "", // (String `json`) Display settings
        "allow_trigger": 0, // (Tinyint `1`) Whether it is possible to use the device as a trigger
        "can_gateway": 0, // (Tinyint `1`) Whether it is possible to use the device as a gateway
        "photo_url": "", // (String `255`) The filename of picture [prefix: /uploads/devices_types/]
        "calibration_json": "" // (String `json`) Calibration settings
    },
    //etc... A list of all available device types
]

/api.devices.groups

Get groups of devices

Is called without parameters.

In the case of a successful response will return a json object:

[
    {
        "id": 0, // (Integer `10`) The internal group ID of Telemetric.app
        "title": "", // (String `255`) A name of group type
        "icon": "", // (String `50`) A CSS class of <http://fontawesome.io>
        "order_by": 0, // (Tityint `3`) The group display order
        "enabled": 0, // (Tityint ```) A sign activity of group
        "i18n": "", // (String `50`) Label for i18n
        "svg_url": "" // (String `255`) The filename of svg picture [prefix: /images/devices/]
    },
    //etc... A list of all available device groups
]

/api.devices.one

The request the available fields for a specific device.

PARAMETERTYPEDESCRIPTION
deviceIdInteger 10 (required)The internal device ID of Telemetric.app

In the case of a successful response will return a json object:

{
    "id": 0, // (Integer `10`) The internal device ID of Telemetric.app
    "deviceID": "", // (String `255`) The ID of this divice [DevAddr for LORA protocol]
    "gatewayID": "", // (String `255`) The gateway ID or empty string
    "port_addr": "", // (String `20`) The port address for gateway or empty string
    "inside_addr": "", // (String `10`) The internal address of the device behind the gateway
    "title": "", // (String `255`) A name of device
    "device_type_id": 0, // (Integer `10`) The link on type
    "desc": "", // (Text `65535`) The description
    "creator_id": 0, // (Integer `10`) The creator id of this device
    "last_active": null, // (Integer `11`) A timestamp of device last activity
    "created_at": "", // (Timestamp or null) A timestamp of creating device
    "deleted": null, // (Timestamp or null) A timestamp of deleting device
    "keyAp": "", // (String `64` or null) Application session key
    "keyNw": "", // (String `64` or null) Network session key
    "amount_inputs": 0, // (Tinyint `3`) The amount of inputs
    "amount_outputs": 0, // (Tinyint `3`) The amount of outputs
    "_232": 0, // (Tinyint `1`) A sign of the presence of the entrance 232
    "_485": 0, // (Tinyint `1`) A sign of the presence of the entrance 485
    "report_period_update": 0, // (Integer `6`) The collection period of this type of device
    "report_online_settings": "", // (String `json`) Display settings
    "allow_trigger": 0, // (Tinyint `1`) Whether it is possible to use the device as a trigger
    "calibration_json": "" // (String `json`) Calibration settings
    "attributes": [ // Array of device properties
        {
            "id": 0, // (Integer `10`) The internal attribute ID
            "is_system": 0, // (Tinyint `1`) A sign of the system attribute
            "title": "", // (String `50`) The label for i18n or name of attribute
            "value": "", // (String `255`) The value of attribute [max length depends on the type of the attribute]
            "type": "", // (String `50`) Any type from the list ["string", "integer", "date-time", "boolean", "var", "virtual-device"]
            "type_id": 0, // (Integer `10`) The type ID of attribute type
            "mask": "", // (String `255`) The mask RegExp [depends on the type of the attribute]
            "max_length": 0, // (Integer `10`) Max length of value [depends on the type of the attribute]
            "reaction_event": 0 // (Tinyint `1`) A sign of the presence of the reaction in the procedure of notification
        },
        // etc...
    ]
}


/api.devices.search

The request the available fields for a specific device.

PARAMETERTYPEDESCRIPTION
searchtext255 (required)search device by like ID, title or description and by all device properties

In the case of a successful response will return a json object:

[
    // A list of all available devices (with fields) or empty list [See chapter: /api.devices.one]
]

/api.devices.all

A list of all available devices for user (with fields)

Is called without parameters.

In the case of a successful response will return a json object:

[


// A list of all available devices (with fields) or empty list [See chapter: /api.devices.one]

]


/api.devices.create

Create new device

PARAMETERTYPEDESCRIPTION
deviceIDString 255 (required)The ID of this device [DevAddr for LORA protocol]
deviceGatewayTinyint 1The sign of presence device gateway. If >0: [Gateway parameters must be present]
gatewayIDString 255 (required)The gateway ID or empty string
inside_addrString 10 (required)The internal address of the device behind the gateway
deviceTitleString 255 (required)A name of new device
deviceDescString 65535The description
deviceTypeInteger 10 (required)Type of new device, the link on internal type. See api.devices.types
keyApString 64 or nullApplication session key
keyNwString 64 or nullNetwork session key

In the case of a successful response will return a json object:

{
    // Returns the available fields for the new device [See chapter: /api.devices.one]
}

/api.devices.remove

The request for remove device into basket.

PARAMETERTYPEDESCRIPTION
deviceIdInteger 10 (required)The internal device ID of Telemetric.app

In the case of a successful response will return a json object:

{
    // Returns the updated available fields for the device [See chapter: /api.devices.one]
}

/api.devices.restore

The request for restore device from the basket.

PARAMETERTYPEDESCRIPTION
deviceIdInteger 10 (required)The internal device ID of Telemetric.app

In the case of a successful response will return a json object:

{
    // Returns the updated available fields for the device [See chapter: /api.devices.one]
}

/api.devices.messages

Get messages of device

PARAMETERTYPEDESCRIPTION
deviceIdInteger 10 (required)The internal device ID of Telemetric.app
timestampBeginInteger 11 (required)A timestamp of the beginning of the messages
timestampEndInteger 11 (required)A timestamp of the ending of the messages
groupingTinyint 1Grouping messages. Variant from list [0: without grouping, 1: by days, 2: by weeks, 3: by months, 4: by years]. default: 1
timeZoneInteger
11
In seconds, example the offset is 4 hours (14400 sec / 60 / 60 = 4 hour)
calibration_jsonString jsonCalibration settings: Default: applying settings from the type of device. See api.devices.types
timeZone


In the case of a successful response will return a json object:

{
    "messages": [] // Array of messages on period
}

Did this solve your problem?