{"id":20036,"date":"2017-07-14T13:44:54","date_gmt":"2017-07-14T18:44:54","guid":{"rendered":"http:\/\/www.multitech.net\/developer\/?page_id=20036"},"modified":"2017-07-14T13:44:54","modified_gmt":"2017-07-14T18:44:54","slug":"example-devices","status":"publish","type":"page","link":"https:\/\/www.multitech.net\/developer\/software\/devicehq\/account-api\/account-api-examples\/example-devices\/","title":{"rendered":"Example &#8211; Devices"},"content":{"rendered":"<ul>\n<li>GET \/api\/v2\/devices?limit=1\n<ul>\n<li>Returns list of devices. Supports search and pagination.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<pre class=\"brush:xml\">{\r\n  \"data\": [\r\n    {\r\n      \"id\": \"MTS-JP-103\",\r\n      \"type\": \"devices\",\r\n      \"attributes\": {\r\n        \"product\": \"MTR-H5\",\r\n        \"group\": \"\",\r\n        \"serial\": \"MTS-JP-103\",\r\n        \"provider\": \"AT&amp;T\",\r\n        \"description\": \"\",\r\n        \"firmware\": \"3.0.9\",\r\n        \"position\": null,\r\n        \"last_checkin\": \"2015-12-15T20:30:17.129+00:00\",\r\n        \"active_apps\": null,\r\n        \"dhcp\": {\r\n          \"enabled\": true,\r\n          \"range_start\": \"192.168.2.100\",\r\n          \"range_end\": \"192.168.2.254\",\r\n          \"lease_time\": 86400,\r\n          \"netmask\": \"255.255.255.0\",\r\n          \"gateway\": \"192.168.2.1\",\r\n          \"dns\": \"192.168.2.1\"\r\n        },\r\n        \"enabled\": true,\r\n        \"hardware_version\": \"REV C\",\r\n        \"lora_network\": {},\r\n        \"ethernet\": {\r\n          \"name\": \"eth0\",\r\n          \"link_type\": \"LINK_TYPE_ETHER\",\r\n          \"mtu\": 1500,\r\n          \"mac\": \"5B:3C:1D:BF:0F:E4\",\r\n          \"gateway\": \"0.0.0.0\",\r\n          \"name_servers\": [],\r\n          \"flags\": {\r\n            \"up\": true,\r\n            \"lower_up\": true,\r\n            \"loopback\": false,\r\n            \"broadcast\": true,\r\n            \"pointtopoint\": false,\r\n            \"multicast\": false,\r\n            \"dynamic\": false,\r\n            \"noarp\": false,\r\n            \"allmulti\": false,\r\n            \"promisc\": false\r\n          },\r\n          \"link_statistics\": {\r\n            \"rx_bytes\": 69985,\r\n            \"rx_packets\": 551,\r\n            \"rx_errors\": 48,\r\n            \"rx_dropped\": 6,\r\n            \"rx_overrun\": 9,\r\n            \"rx_multicast\": 0,\r\n            \"tx_bytes\": 72739,\r\n            \"tx_packets\": 572,\r\n            \"tx_errors\": 43,\r\n            \"tx_dropped\": 2,\r\n            \"tx_carrier\": 9,\r\n            \"tx_collisions\": 0\r\n          }\r\n        },\r\n        \"cell_radio\": {\r\n          \"firmware\": \"12.00.024\",\r\n          \"phone_number\": \"1107069877\",\r\n          \"provider\": \"AT&amp;T\",\r\n          \"rssi\": -107,\r\n          \"imsi\": null,\r\n          \"up_time\": null\r\n        },\r\n        \"wifi\": {\r\n          \"name\": \"wlan0\",\r\n          \"link_type\": \"LINK_TYPE_ETHER\",\r\n          \"mtu\": 1500,\r\n          \"ip_addr\": \"192.168.235.19\",\r\n          \"netmask\": \"255.255.255.0\",\r\n          \"gateway\": \"192.168.235.1\",\r\n          \"name_servers\": [],\r\n          \"flags\": {\r\n            \"up\": true,\r\n            \"lower_up\": true,\r\n            \"loopback\": false,\r\n            \"broadcast\": true,\r\n            \"pointtopoint\": false,\r\n            \"multicast\": false,\r\n            \"dynamic\": false,\r\n            \"noarp\": false,\r\n            \"allmulti\": false,\r\n            \"promisc\": false\r\n          },\r\n          \"link_statistics\": {\r\n            \"rx_bytes\": 119803,\r\n            \"rx_packets\": 943,\r\n            \"rx_errors\": 41,\r\n            \"rx_dropped\": 1,\r\n            \"rx_overrun\": 8,\r\n            \"rx_multicast\": 0,\r\n            \"tx_bytes\": 338173,\r\n            \"tx_packets\": 2662,\r\n            \"tx_errors\": 77,\r\n            \"tx_dropped\": 5,\r\n            \"tx_carrier\": 5,\r\n            \"tx_collisions\": 0\r\n          },\r\n          \"wifi\": {\r\n            \"mode\": \"client\",\r\n            \"client\": {\r\n              \"mode\": \"WAN\",\r\n              \"security_mode\": \"WPA2-PSK\",\r\n              \"ssid\": \"ez-test\",\r\n              \"rssi\": -85\r\n            }\r\n          }\r\n        },\r\n        \"up_time\": \" 127 days\",\r\n        \"up_time_seconds\": null,\r\n        \"supports\" : {\r\n          \"logs\" : true,\r\n          \"configs\" : false,\r\n          \"apps\" : false,\r\n        },\r\n        \"has_radio\": true\r\n      }\r\n    }\r\n  ],\r\n  \"meta\": {\r\n    \"skip\": 0,\r\n    \"limit\": 1,\r\n    \"total\": 67\r\n  }\r\n}<\/pre>\n<ul>\n<li>GET \/api\/v2\/devices\/(serial or UUID)\n<ul>\n<li>Returns single device identified by serial# or UUID.<br \/>\nWill include all fields that are presently visible when user clicks on a device in DeviceHQ.com<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<pre class=\"brush:xml\">{\r\n  \"result\": \"ok\",\r\n  \"token\": \"i9eTvNmbinALex\",\r\n  \"data\": {\r\n    \"id\": \"MTS-JP-003\",\r\n    \"type\": \"devices\",\r\n    \"attributes\": {\r\n      \"product\": \"MTR-H5\",\r\n      \"group\": \"Group 00X\",\r\n      \"serial\": \"MTS-JP-003\",\r\n      \"provider\": \"AT&amp;T\",\r\n      \"description\": \"East wing of library building\",\r\n      \"location_description\": [-27.6234,93.2],\r\n      \"software_version\": \"3.0.9\",\r\n      \"hardware_version\": \"1.2b\",\r\n      \"last_checkin\": \"2015-12-15T20:30:13.107+00:00\",\r\n      \"enabled\": true,\r\n      \"hardware_version\": \"REV C\",\r\n      \"lora_network\": {},\r\n      \"active_apps\": [ \r\n        { \"status\": \"READY\", \r\n          \"info\": \"aaaa\", \r\n          \"name\": \" Hello World\", \r\n          \"version\": \"1.0.1\", \r\n          \"type\": \"app\", \r\n          \"id\": \"57ee3aa4ed3e892698000057\"\r\n        }, \r\n        { \"status\": \"READY\", \r\n          \"info\": null, \r\n          \"name\":\"APPTEST\", \r\n          \"version\": \"22.22\", \r\n          \"type\": \"app\", \r\n          \"id\": \"581cb7dbed3e89c60100004c\"\r\n        }\r\n      ],\r\n      \"dhcp\": {\r\n        \"enabled\": true,\r\n        \"range_start\": \"192.168.2.100\",\r\n        \"range_end\": \"192.168.2.254\",\r\n        \"lease_time\": 86400,\r\n        \"netmask\": \"255.255.255.0\",\r\n        \"gateway\": \"192.168.2.1\",\r\n        \"dns\": \"192.168.2.1\"\r\n      },\r\n      \"ethernet\": {\r\n        \"name\": \"eth0\",\r\n        \"link_type\": \"LINK_TYPE_ETHER\",\r\n        \"mtu\": 1500,\r\n        \"mac\": \"F7:F8:86:0D:68:91\",\r\n        \"gateway\": \"0.0.0.0\",\r\n        \"name_servers\": [],\r\n        \"flags\": {\r\n          \"up\": true,\r\n          \"lower_up\": true,\r\n          \"loopback\": false,\r\n          \"broadcast\": true,\r\n          \"pointtopoint\": false,\r\n          \"multicast\": false,\r\n          \"dynamic\": false,\r\n          \"noarp\": false,\r\n          \"allmulti\": false,\r\n          \"promisc\": false\r\n        },\r\n        \"link_statistics\": {\r\n          \"rx_bytes\": 74498,\r\n          \"rx_packets\": 586,\r\n          \"rx_errors\": 58,\r\n          \"rx_dropped\": 1,\r\n          \"rx_overrun\": 8,\r\n          \"rx_multicast\": 0,\r\n          \"tx_bytes\": 73870,\r\n          \"tx_packets\": 581,\r\n          \"tx_errors\": 77,\r\n          \"tx_dropped\": 1,\r\n          \"tx_carrier\": 5,\r\n          \"tx_collisions\": 0\r\n        }\r\n      },\r\n      \"cell_radio\": {\r\n        \"firmware\": \"12.00.024\",\r\n        \"phone_number\": \"1914591206\",\r\n        \"provider\": \"AT&amp;T\",\r\n        \"rssi\": -103,\r\n        \"imsi\": null,\r\n        \"up_time\": null\r\n      },\r\n      \"wifi\": {\r\n        \"name\": \"wlan0\",\r\n        \"link_type\": \"LINK_TYPE_ETHER\",\r\n        \"mtu\": 1500,\r\n        \"ip_addr\": \"192.168.211.211\",\r\n        \"netmask\": \"255.255.255.0\",\r\n        \"gateway\": \"192.168.211.1\",\r\n        \"name_servers\": [],\r\n        \"flags\": {\r\n          \"up\": true,\r\n          \"lower_up\": true,\r\n          \"loopback\": false,\r\n          \"broadcast\": true,\r\n          \"pointtopoint\": false,\r\n          \"multicast\": false,\r\n          \"dynamic\": false,\r\n          \"noarp\": false,\r\n          \"allmulti\": false,\r\n          \"promisc\": false\r\n        },\r\n        \"link_statistics\": {\r\n          \"rx_bytes\": 123939,\r\n          \"rx_packets\": 975,\r\n          \"rx_errors\": 50,\r\n          \"rx_dropped\": 6,\r\n          \"rx_overrun\": 8,\r\n          \"rx_multicast\": 0,\r\n          \"tx_bytes\": 287959,\r\n          \"tx_packets\": 2267,\r\n          \"tx_errors\": 75,\r\n          \"tx_dropped\": 6,\r\n          \"tx_carrier\": 4,\r\n          \"tx_collisions\": 0\r\n        },\r\n        \"wifi\": {\r\n          \"mode\": \"client\",\r\n          \"client\": {\r\n            \"mode\": \"WAN\",\r\n            \"security_mode\": \"WPA2-PSK\",\r\n            \"ssid\": \"mts-test\",\r\n            \"rssi\": -75\r\n          }\r\n        }\r\n      },\r\n      \"up_time\": \" 127 days\",\r\n      \"up_time_seconds\": 23422,\r\n      \"supports\" : {\r\n        \"logs\" : true,\r\n        \"configs\" : false,\r\n        \"apps\" : false,\r\n      },\r\n      \"has_radio\": true\r\n    }\r\n  }\r\n}\r\n\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>GET \/api\/v2\/devices?limit=1 Returns list of devices. Supports search and pagination. { &#8220;data&#8221;: [ { &#8220;id&#8221;: &#8220;MTS-JP-103&#8221;, &#8220;type&#8221;: &#8220;devices&#8221;, &#8220;attributes&#8221;: { &#8220;product&#8221;: &#8220;MTR-H5&#8221;, &#8220;group&#8221;: &#8220;&#8221;, &#8220;serial&#8221;: &#8220;MTS-JP-103&#8221;, &#8220;provider&#8221;: &#8220;AT&amp;T&#8221;, &#8220;description&#8221;: &#8220;&#8221;, &#8220;firmware&#8221;: &#8220;3.0.9&#8221;, &#8220;position&#8221;: null, &#8220;last_checkin&#8221;: &#8220;2015-12-15T20:30:17.129+00:00&#8221;, &#8220;active_apps&#8221;: null, &#8220;dhcp&#8221;: { &#8220;enabled&#8221;: true, &#8220;range_start&#8221;: &#8220;192.168.2.100&#8221;, &#8220;range_end&#8221;: &#8220;192.168.2.254&#8221;, &#8220;lease_time&#8221;: 86400, &#8220;netmask&#8221;: &#8220;255.255.255.0&#8221;, &#8220;gateway&#8221;: &#8220;192.168.2.1&#8221;, &#8220;dns&#8221;: &#8220;192.168.2.1&#8221; }, [&hellip;]<\/p>\n","protected":false},"author":2082,"featured_media":0,"parent":20000,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"class_list":["post-20036","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/20036","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/users\/2082"}],"replies":[{"embeddable":true,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/comments?post=20036"}],"version-history":[{"count":5,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/20036\/revisions"}],"predecessor-version":[{"id":32840,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/20036\/revisions\/32840"}],"up":[{"embeddable":true,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/20000"}],"wp:attachment":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/media?parent=20036"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}