Example – Devices

  • GET /api/v2/devices?limit=1
    • Returns list of devices. Supports search and pagination.
{
  "data": [
    {
      "id": "MTS-JP-103",
      "type": "devices",
      "attributes": {
        "product": "MTR-H5",
        "group": "",
        "serial": "MTS-JP-103",
        "provider": "AT&T",
        "description": "",
        "firmware": "3.0.9",
        "position": null,
        "last_checkin": "2015-12-15T20:30:17.129+00:00",
        "active_apps": null,
        "dhcp": {
          "enabled": true,
          "range_start": "192.168.2.100",
          "range_end": "192.168.2.254",
          "lease_time": 86400,
          "netmask": "255.255.255.0",
          "gateway": "192.168.2.1",
          "dns": "192.168.2.1"
        },
        "enabled": true,
        "hardware_version": "REV C",
        "lora_network": {},
        "ethernet": {
          "name": "eth0",
          "link_type": "LINK_TYPE_ETHER",
          "mtu": 1500,
          "mac": "5B:3C:1D:BF:0F:E4",
          "gateway": "0.0.0.0",
          "name_servers": [],
          "flags": {
            "up": true,
            "lower_up": true,
            "loopback": false,
            "broadcast": true,
            "pointtopoint": false,
            "multicast": false,
            "dynamic": false,
            "noarp": false,
            "allmulti": false,
            "promisc": false
          },
          "link_statistics": {
            "rx_bytes": 69985,
            "rx_packets": 551,
            "rx_errors": 48,
            "rx_dropped": 6,
            "rx_overrun": 9,
            "rx_multicast": 0,
            "tx_bytes": 72739,
            "tx_packets": 572,
            "tx_errors": 43,
            "tx_dropped": 2,
            "tx_carrier": 9,
            "tx_collisions": 0
          }
        },
        "cell_radio": {
          "firmware": "12.00.024",
          "phone_number": "1107069877",
          "provider": "AT&T",
          "rssi": -107,
          "imsi": null,
          "up_time": null
        },
        "wifi": {
          "name": "wlan0",
          "link_type": "LINK_TYPE_ETHER",
          "mtu": 1500,
          "ip_addr": "192.168.235.19",
          "netmask": "255.255.255.0",
          "gateway": "192.168.235.1",
          "name_servers": [],
          "flags": {
            "up": true,
            "lower_up": true,
            "loopback": false,
            "broadcast": true,
            "pointtopoint": false,
            "multicast": false,
            "dynamic": false,
            "noarp": false,
            "allmulti": false,
            "promisc": false
          },
          "link_statistics": {
            "rx_bytes": 119803,
            "rx_packets": 943,
            "rx_errors": 41,
            "rx_dropped": 1,
            "rx_overrun": 8,
            "rx_multicast": 0,
            "tx_bytes": 338173,
            "tx_packets": 2662,
            "tx_errors": 77,
            "tx_dropped": 5,
            "tx_carrier": 5,
            "tx_collisions": 0
          },
          "wifi": {
            "mode": "client",
            "client": {
              "mode": "WAN",
              "security_mode": "WPA2-PSK",
              "ssid": "ez-test",
              "rssi": -85
            }
          }
        },
        "up_time": " 127 days",
        "up_time_seconds": null,
        "supports" : {
          "logs" : true,
          "configs" : false,
          "apps" : false,
        },
        "has_radio": true
      }
    }
  ],
  "meta": {
    "skip": 0,
    "limit": 1,
    "total": 67
  }
}
  • GET /api/v2/devices/(serial or UUID)
    • Returns single device identified by serial# or UUID.
      Will include all fields that are presently visible when user clicks on a device in DeviceHQ.com
{
  "result": "ok",
  "token": "i9eTvNmbinALex",
  "data": {
    "id": "MTS-JP-003",
    "type": "devices",
    "attributes": {
      "product": "MTR-H5",
      "group": "Group 00X",
      "serial": "MTS-JP-003",
      "provider": "AT&T",
      "description": "East wing of library building",
      "location_description": [-27.6234,93.2],
      "software_version": "3.0.9",
      "hardware_version": "1.2b",
      "last_checkin": "2015-12-15T20:30:13.107+00:00",
      "enabled": true,
      "hardware_version": "REV C",
      "lora_network": {},
      "active_apps": [ 
        { "status": "READY", 
          "info": "aaaa", 
          "name": " Hello World", 
          "version": "1.0.1", 
          "type": "app", 
          "id": "57ee3aa4ed3e892698000057"
        }, 
        { "status": "READY", 
          "info": null, 
          "name":"APPTEST", 
          "version": "22.22", 
          "type": "app", 
          "id": "581cb7dbed3e89c60100004c"
        }
      ],
      "dhcp": {
        "enabled": true,
        "range_start": "192.168.2.100",
        "range_end": "192.168.2.254",
        "lease_time": 86400,
        "netmask": "255.255.255.0",
        "gateway": "192.168.2.1",
        "dns": "192.168.2.1"
      },
      "ethernet": {
        "name": "eth0",
        "link_type": "LINK_TYPE_ETHER",
        "mtu": 1500,
        "mac": "F7:F8:86:0D:68:91",
        "gateway": "0.0.0.0",
        "name_servers": [],
        "flags": {
          "up": true,
          "lower_up": true,
          "loopback": false,
          "broadcast": true,
          "pointtopoint": false,
          "multicast": false,
          "dynamic": false,
          "noarp": false,
          "allmulti": false,
          "promisc": false
        },
        "link_statistics": {
          "rx_bytes": 74498,
          "rx_packets": 586,
          "rx_errors": 58,
          "rx_dropped": 1,
          "rx_overrun": 8,
          "rx_multicast": 0,
          "tx_bytes": 73870,
          "tx_packets": 581,
          "tx_errors": 77,
          "tx_dropped": 1,
          "tx_carrier": 5,
          "tx_collisions": 0
        }
      },
      "cell_radio": {
        "firmware": "12.00.024",
        "phone_number": "1914591206",
        "provider": "AT&T",
        "rssi": -103,
        "imsi": null,
        "up_time": null
      },
      "wifi": {
        "name": "wlan0",
        "link_type": "LINK_TYPE_ETHER",
        "mtu": 1500,
        "ip_addr": "192.168.211.211",
        "netmask": "255.255.255.0",
        "gateway": "192.168.211.1",
        "name_servers": [],
        "flags": {
          "up": true,
          "lower_up": true,
          "loopback": false,
          "broadcast": true,
          "pointtopoint": false,
          "multicast": false,
          "dynamic": false,
          "noarp": false,
          "allmulti": false,
          "promisc": false
        },
        "link_statistics": {
          "rx_bytes": 123939,
          "rx_packets": 975,
          "rx_errors": 50,
          "rx_dropped": 6,
          "rx_overrun": 8,
          "rx_multicast": 0,
          "tx_bytes": 287959,
          "tx_packets": 2267,
          "tx_errors": 75,
          "tx_dropped": 6,
          "tx_carrier": 4,
          "tx_collisions": 0
        },
        "wifi": {
          "mode": "client",
          "client": {
            "mode": "WAN",
            "security_mode": "WPA2-PSK",
            "ssid": "mts-test",
            "rssi": -75
          }
        }
      },
      "up_time": " 127 days",
      "up_time_seconds": 23422,
      "supports" : {
        "logs" : true,
        "configs" : false,
        "apps" : false,
      },
      "has_radio": true
    }
  }
}