Devices

The 'devices' API allows viewing, creating, modifying, and deleting devices in the system. Administrator or super administrator permissions are required.

GET /devices

The GET /devices endpoint provides a paginated list of devices, which can be filtered by the following fields:

  • 'page' (optional): page number to display.
  • 'size' (optional): number of elements per page.
  • 'sort' (optional): sorting order of the elements; can be ascending (ASC) or descending (DESC) and is based on any of the attributes by which to filter.
  • 'id' (optional): device identifier.
  • 'name' (optional): device name.
  • 'mnemonic' (optional): mnemonic name of the device.
  • 'contextBrokerId' (optional): identifier in the context broker of the device.
  • 'network' (optional): network to which the device belongs; there are three possibilities: 'Lora', 'NBIOT', or 'Wifi'.
  • 'description' (optional): description of the device.
  • 'vendor' (optional): company selling the device.
  • 'brand' (optional): brand of the device.
  • 'model' (optional): model of the device.
  • 'firmware' (optional)
  • 'serialNumber' (optional): serial number of the device.
  • 'heritageId' (optional): inherited identifier of the device.
  • 'state' (optional): state of the device; there are three states: 'activated', 'disabled', or 'discharged'.
  • 'stateDate' (optional): date of the last state change of the device.
  • 'stateBy' (optional): user responsible for the last state change of the device.
  • 'createDate' (optional): creation date of the device.
  • 'createBy' (optional): user responsible for the creation of the device.
  • 'updateDate' (optional): update date of the device.
  • 'updateBy' (optional): user responsible for the update of the device.
  • 'template' (optional): boolean indicating if the device is a template.
  • 'organization' (mandatory): organization to which the device belongs.
  • 'type.id' (optional): identifier of the device type.
  • 'type.name' (optional): name of the device type.
  • 'type.hasDevices' (optional): whether there are devices associated with this type.
  • 'type.toBeProcessed' (optional): boolean indicating if this type of device should be processed.
  • 'type.dashboards.id' (optional): id of an associated dashboard.
  • 'type.dashboards.title' (optional): title of an associated dashboard.
  • 'type.dashboards.url' (optional): url of the associated dashboard.
  • 'type.dashboards.folderId' (optional): id of the folder containing an associated dashboard.
  • 'type.dashboards.folderTitle' (optional): title of the folder containing an associated dashboard.
  • 'type.dashboards.folderUid' (optional): uid of the folder containing an associated dashboard.
  • 'type.dashboards.folderUrl' (optional): url of the folder containing an associated dashboard.
  • 'verticals.id' (optional): identifier of the vertical.
  • 'verticals.name' (optional): name of the vertical.
  • 'verticals.description' (optional): description of the vertical.
  • 'verticals.dashboards.id' (optional): title of an associated dashboard.
  • 'verticals.dashboards.title' (optional): id of the folder containing an associated dashboard.
  • 'verticals.dashboards.url' (optional): url of the associated dashboard.
  • 'verticals.dashboards.folderId' (optional): id of the folder containing an associated dashboard.
  • 'verticals.dashboards.folderTitle' (optional): title of the folder containing an associated dashboard.
  • 'verticals.dashboards.folderUid' (optional): uid of the folder containing an associated dashboard.
  • 'verticals.dashboards.folderUrl' (optional): url of the folder containing an associated dashboard.
  • 'tags.id' (optional): tag identifier.
  • 'tags.name' (optional): tag name.
  • 'attributes.id' (optional): attribute identifier.
  • 'attributes.name' (optional): attribute name.
  • 'attributes.type' (optional): attribute type; there are three types: 'Text', 'Number', or 'DateTime'.
  • 'attributes.unit' (optional): attribute unit.
  • 'attributes.originName' (optional): original name of the attribute.
  • 'attributeStatics.id' (optional): static attribute identifier.
  • 'attributeStatics.name' (optional): static attribute name.
  • 'attributeStatics.type' (optional): static attribute type; there are three types: 'Text', 'Number', or 'DateTime'.
  • 'attributeStatics.value' (optional): static attribute value.
  • 'attributeStatics.unit' (optional): static attribute unit.
  • 'decoder.id' (optional): decoder identifier.
  • 'decoder.name' (optional): decoder name.
  • 'decoder.network' (optional): network to which the decoder belongs; there are three possibilities: 'Lora', 'NBIOT', or 'Wifi'.
  • 'decoder.vendor' (optional): company selling the decoder.
  • 'decoder.model' (optional): model of the decoder.
  • 'decoder.softwareVersion' (optional): software version of the decoder.
  • 'decoder.code' (optional): code to decode messages from the device or devices to which it is associated.
  • 'decoder.lnsId' (optional): LNS identifier of the decoder.
  • 'decoder.codecIdHex' (optional): hexadecimal identifier of the decoder.
  • 'decoder.description' (optional): description of the decoder.
  • 'netLora.deveui' (optional)
  • 'netLora.appeui' (optional)
  • 'netLora.appkey' (optional)
  • 'netLora.nwkkey' (optional)
  • 'loraProfileId' (optional): Lora profile identifier.
  • 'netNBIoT.deviceId' (optional): NBIOT identifier.
  • 'netWifi.mac' (optional): mac associated with the device.

GET /devices/{id}

The GET /devices/{id} endpoint provides the device by its id.

GET /devices/{id}/template

The GET /devices/{id}/template endpoint provides the template of a device by its id.

GET /devices/{id}/CSV

The GET /devices/{id}/CSV endpoint provides the CSV template of a device by its id.

POST /devices

The POST /devices endpoint creates a new device and must have the following format:

{
  "name": "device1",
  "type": 1,
  "decoder": 5,
  "network": "Lora",
  "vendor": "vendor",
  "brand": "brand",
  "model": "model",
  "firmware": "firmware",
  "serialNumber": "5524",
  "heritageId": "123456",
  "description": "New Device",
  "loraProfileId": 10,
  "template": true,
  "attributes": [
    {
      "name": "temperature",
      "originName": "temp",
      "type": "Text",
      "unit": "celsius"
    }
  ],
  "staticAttributes": [
    {
      "name": "width",
      "type": "Text",
      "unit": "meters",
      "value": "15"
    }
  ],
  "tags": [
    2
  ],
  "verticals": [
    5
  ],
  "netLora": {
    "appeui": "1234167896544368",
    "appkey": "1234567896544268",
    "deveui": "12345678965442681234567896544268",
    "nwkkey": "1234567896544268"
  },
  "netNBIoT": {
    "deviceId": "1234"
  },
  "netWifi": {
    "mac": "Fb:AF-67-Eb:ef:D6"
  }
}
  • 'name' (required): name of the device.
  • 'type' (optional): boolean indicating if this type of device should be processed.
  • 'decoder' (optional): decoder identifier.
  • 'network' (required): network to which the device belongs; there are three possibilities: 'Lora', 'NBIOT', or 'Wifi'.
  • 'vendor' (optional): company selling the device.
  • 'brand' (optional): brand of the device.
  • 'model' (optional): model of the device.
  • 'firmware' (optional)
  • 'serialNumber' (optional): serial number of the device.
  • 'heritageId' (optional): inherited identifier of the device.
  • 'description' (optional): description of the device.
  • 'loraProfileId' (optional): Lora profile identifier.
  • 'template' (optional): boolean indicating if the device is a template.
  • 'attributes.name' (required when 'attributes' is not null): name of the attribute.
  • 'attributes.originName' (optional): original name of the attribute.
  • 'attributes.type' (required when 'attributes' is not null): attribute type; there are three types: 'Text', 'Number', or 'DateTime'.
  • 'attributes.unit' (optional): attribute unit.
  • 'staticAttributes.name' (required when 'staticAttributes' is not null): name of the attribute.
  • 'staticAttributes.type' (required when 'staticAttributes' is not null): attribute type; there are three types: 'Text', 'Number', or 'DateTime'.
  • 'staticAttributes.value' (required when 'staticAttributes' is not null): attribute value.
  • 'staticAttributes.unit' (optional): attribute unit.
  • 'tags' (optional): list of tag identifiers.
  • 'verticals' (optional): list of vertical identifiers.
  • 'netLora.deveui' (required if it is a Lora type device)
  • 'netLora.appeui' (required if it is a Lora type device)
  • 'netLora.appkey' (required if it is a Lora type device)
  • 'netLora.nwkkey' (optional)
  • 'netNBIoT.deviceId' (required if it is a NBIOT type device): NBIOT identifier.
  • 'netWifi.mac' (required if it is a Wifi type device): mac associated with the device.

PUT /devices/{id}

The PUT /devices/{id} endpoint serves to modify a device by its id. The data that can be modified are as follows:

  • 'description' (optional): description of the device.
  • 'vendor' (optional): company selling the device.
  • 'brand' (optional): brand of the device.
  • 'model' (optional): model of the device.
  • 'firmware' (optional)
  • 'serialNumber' (optional): serial number of the device.
  • 'heritageId' (optional): inherited identifier of the device.
  • 'verticals' (optional): list of vertical identifiers associated with the device.
  • 'tags' (optional): list of tag identifiers associated with the device.
  • 'attributes.name' (required if 'attributes' is not null): name of the attribute.
  • 'attributes.type' (required if 'attributes' is not null): attribute type; there are three types: 'Text', 'Number', or 'DateTime'.
  • 'attributes.unit' (optional): attribute unit.
  • 'attributes.originName' (optional): original name of the attribute.
  • 'attributeStatics.name' (required if 'attributeStatics' is not null): name of the attribute.
  • 'attributeStatics.type' (required if 'attributeStatics' is not null): attribute type; there are three types: 'Text', 'Number', or 'DateTime'.
  • 'attributeStatics.value' (required if 'attributeStatics' is not null): attribute value.
  • 'attributeStatics.unit' (optional): attribute unit.
  • 'decoder' (optional): decoder identifier.
  • 'template' (optional): boolean indicating if the device is a template.

PUT /devices/{id}/reactivate

The PUT /devices/{id}/reactivate endpoint serves to modify the state of a device by its id. There are three possible states: 'activated', 'disabled', or 'discharged'.

DELETE /devices/{id}

The DELETE /devices/{id} endpoint deletes the device by its id.