API.Devices


/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 Nekta.cloud
        "deviceTypeID": 0, // (Integer `11`) The internal type ID of Nekta.cloud 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 Nekta.cloud
        "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.

Parameter Type Description
deviceId Integer 10 (required) The internal device ID of Nekta.cloud

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

{
    "id": 0, // (Integer `10`) The internal device ID of Nekta.cloud
    "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.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

Parameter Type Description
deviceID String 255 (required) The ID of this device [DevAddr for LORA protocol]
deviceGateway Tinyint 1 The sign of presence device gateway. If >0: [Gateway parameters must be present]
gatewayID String 255 (required) The gateway ID or empty string
inside_addr String 10 (required) The internal address of the device behind the gateway
deviceTitle String 255 (required) A name of new device
deviceDesc String 65535 The description
deviceType Integer 10 (required) Type of new device, the link on internal type. See #/api.devices.types
keyAp String 64 or null Application session key
keyNw String 64 or null Network 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.

Parameter Type Description
deviceId Integer 10 (required) The internal device ID of Nekta.cloud

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.

Parameter Type Description
deviceId Integer 10 (required) The internal device ID of Nekta.cloud

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

Parameter Type Description
deviceId Integer 10 (required) The internal device ID of Nekta.cloud
timestampBegin Integer 11 (required) A timestamp of the beginning of the messages
timestampEnd Integer 11 (required) A timestamp of the ending of the messages
grouping Tinyint 1 Grouping messages. Variant from list [0: without grouping, 1: by days, 2: by weeks, 3: by months, 4: by years]. default: 1
report_online_settings String json Display settings. Default: appling settings from the type of device. See #/api.devices.types
calibration_json String json Calibration settings: Default: appling settings from the type of device. See #/api.devices.types

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

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