IoT Stadium

API Documentation

Device

Device - POST Add Device (MQTT/BLE/HTTP/LoRa)

Adding a device that uses MQTT, BLE, HTTP, or LoRa protocol

Post
{{url_iot_backend}}/ext/devices

Parameter

Field Type Description
name Text

Name of the devices (required)

label Text

Label for your new device

type Text

Set the type for your device

device_type_id Text

The ID for your device type (Must be an integer)

group_device Number

Set the group for your device

description Text

Set the description for your device

device_type_predefined Number

The code for your device type

device_image_default Text

The code for your device image

device_connectivity_type Number

The code for your device connectivity type (required)

device_network Number

The code for your device network

location_id Text

The ID for your the assigned location for your device

location_custom_field Text

The additional field for your location

hardware_id Number

ID for your hardware (Required if the connectivity type is BLE)

device_network_id Number

The ID for your device network

{
    "name": "testing device", // required
    "label": null, 
    "type": null,
    "device_type_id" : "320", // must be a integer
    "group_device": 46,
    "description": null,
    "device_type_predefined" : 1,
    "device_image_default": null,
    "device_connectivity_type": 100, // required
    "device_network": 1,
    "location_id": null,
    "location_custom_field": [],
    "device_connectivity_type_id": 1, 
    "hardware_id" : 66412, // required if device connectivity type BLE 
    "device_network_id": 2
}                                            
{
    "message": "device created",
    "data": {
        "id": 584
    },
    "code": 200
}
{
    "message": "Invalid Message",
    "code": 400,
    "errors": [
        {
            "field": "name",
            "message": "The name field is required.."
        },
        {
            "field": "hardware_id",
            "message": "The hardware id must be at least 3 characters."
        }
    ]
}                                                
{
    "message": "Invalid Message",
    "code": 400,
    "errors": [
        {
            "field": "device_type_id",
            "message": "The selected device type id is invalid."
        },
        {
            "field": "hardware_id",
            "message": "hardware_id already registered on device id 584"
        }
    ]
}