{"id":23207,"date":"2018-04-19T10:57:12","date_gmt":"2018-04-19T15:57:12","guid":{"rendered":"http:\/\/www.multitech.net\/developer\/?page_id=23207"},"modified":"2021-05-06T07:33:28","modified_gmt":"2021-05-06T12:33:28","slug":"managing-device-list-through-api","status":"publish","type":"page","link":"https:\/\/www.multitech.net\/developer\/software\/lora\/getting-started-with-lora-conduit-aep\/managing-device-list-through-api\/","title":{"rendered":"Managing device list through API"},"content":{"rendered":"<p>The unique appkeys associated with end-device deveui&#8217;s can be managed through the Conduit AEP API.<br \/>\nBelow are several examples of operations for managing the list. <\/p>\n<p>\nNotes:<\/p>\n<ul>\n<li>Changes to the devices list must be saved in order to persist across power cycle<\/li>\n<li>The network server must be restarted to load the new list<\/li>\n<\/ul>\n<h3>Enable whitelist join server Local Keys instead of Cloud Key Store<\/h3>\n<pre class=\"brush:shell\">curl 127.0.0.1\/api\/loraNetwork\/whitelist -X PUT --data '{\"enabled\":true}' -H \"Content-Type: application\/json\"<\/pre>\n<h3>Bulk upload or replace the entire list<\/h3>\n<pre class=\"brush:shell\">curl 127.0.0.1\/api\/loraNetwork\/whitelist -X PUT --data '{\"devices\":[{\"deveui\":\"0001223344556677\",\"appeui\":\"0011223344556677\",\"appkey\":\"00112233445566770011223344556677\"},{\"deveui\":\"0011223344556677\",\"appeui\":\"0011223344556677\",\"appkey\":\"00112233445566770011223344556677\"}]}' -H \"Content-Type: application\/json\"<\/pre>\n<p>Device and Network Profiles can also be set.<\/p>\n<pre class=\"brush:shell\">\r\n\"device_profile_id\" : \"LW102-OTA-US915\"\r\n\"network_profile_id\" : \"DEFAULT-CLASS-A\"\r\n<\/pre>\n<h3>Save API changes<\/h3>\n<pre class=\"brush:shell\">curl 127.0.0.1\/api\/command\/save -X POST --data \"\"<\/pre>\n<h3>Restart Network Server<\/h3>\n<pre class=\"brush:shell\">curl 127.0.0.1\/api\/lora\/restart -X POST --data \"\"<\/pre>\n<h3>Remove all end-devices<\/h3>\n<pre class=\"brush:shell\">curl 127.0.0.1\/api\/loraNetwork\/whitelist\/devices -X DELETE<\/pre>\n<h3>Remove one end-device at index 0<\/h3>\n<pre class=\"brush:shell\">curl 127.0.0.1\/api\/loraNetwork\/whitelist\/devices\/0 -X DELETE<\/pre>\n<h3>Add a device to end of list<\/h3>\n<pre class=\"brush:shell\">curl 127.0.0.1\/api\/loraNetwork\/whitelist\/devices -X POST --data '{\"deveui\":\"0001223344556677\",\"class\":\"A\",\"appeui\":\"0011223344556677\",\"appkey\":\"00112233445566770011223344556677\"}' -H \"Content-Type: application\/json\"<\/pre>\n<h3>Edit a device at index 0<\/h3>\n<pre class=\"brush:shell\">curl 127.0.0.1\/api\/loraNetwork\/whitelist\/devices\/0 -X PUT --data '{\"deveui\":\"0001223344556677\",\"class\":\"A\",\"appeui\":\"0011223344556677\",\"appkey\":\"00112233445566770011223344556677\"}' -H \"Content-Type: application\/json\"<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The unique appkeys associated with end-device deveui&#8217;s can be managed through the Conduit AEP API. Below are several examples of operations for managing the list. Notes: Changes to the devices list must be saved in order to persist across power cycle The network server must be restarted to load the new list Enable whitelist join [&hellip;]<\/p>\n","protected":false},"author":1337,"featured_media":0,"parent":8083,"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-23207","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/23207","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\/1337"}],"replies":[{"embeddable":true,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/comments?post=23207"}],"version-history":[{"count":7,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/23207\/revisions"}],"predecessor-version":[{"id":31795,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/23207\/revisions\/31795"}],"up":[{"embeddable":true,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/8083"}],"wp:attachment":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/media?parent=23207"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}