{"id":3520,"date":"2020-10-07T12:11:38","date_gmt":"2020-10-07T12:11:38","guid":{"rendered":"https:\/\/www.hexnode.com\/mobile-device-management\/api\/?page_id=3520"},"modified":"2021-11-26T05:13:38","modified_gmt":"2021-11-26T05:13:38","slug":"edit-device-attribute","status":"publish","type":"page","link":"https:\/\/www.hexnode.com\/mobile-device-management\/developers\/actions\/edit-device-attribute\/","title":{"rendered":"Edit Device Attribute"},"content":{"rendered":"<div class=\"method-copy\">\n<div class=\"method-copy-padding\">\n<h2>Edit Device Attribute<\/h2>\n<p>Edit device attributes like Device Name, Description, Ownership and more for devices.<\/p>\n<div class=\"table-responsive\">\n<table id=\"table_61516733\" class=\"table table-bordered\" width=\"100%\">\n<thead>\n<tr>\n<th width=\"15%\"><strong>Argument<\/strong><\/th>\n<th width=\"12%\"><strong>Type<\/strong><\/th>\n<th width=\"30%\"><strong>Description<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Update_in_bulk<\/td>\n<td>Boolean type<\/td>\n<td>Update attributes of devices in bulk.<\/td>\n<\/tr>\n<tr>\n<td>Update_single_device<\/td>\n<td>Boolean type<\/td>\n<td>Update attributes of a single device.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div class=\"note\">\n<p><b>Note:<\/b> Please note that Update_in_bulk and Update_single_device can\u2019t be set true simultaneously.<\/p>\n<\/div>\n<p>If Update_in_bulk is set to true, the following fields can be configured.<\/p>\n<div class=\"table-responsive\">\n<table id=\"table_61516733\" class=\"table table-bordered\" width=\"100%\">\n<thead>\n<tr>\n<th width=\"15%\"><strong>Argument<\/strong><\/th>\n<th width=\"12%\"><strong>Type<\/strong><\/th>\n<th width=\"30%\"><strong>Description<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Device_ID<\/td>\n<td>Array<\/td>\n<td>Mandatory.<br \/>\nSpecify the list of device IDs.<\/td>\n<\/tr>\n<tr>\n<td>Device_name<\/td>\n<td>Character<\/td>\n<td>Optional.<br \/>\nSpecify the device name of the devices.<\/td>\n<\/tr>\n<tr>\n<td>Asset_Tag<\/td>\n<td>Character<\/td>\n<td>Optional.<br \/>\nSpecify the asset tag of the devices.<\/td>\n<\/tr>\n<tr>\n<td>Department<\/td>\n<td>Character<\/td>\n<td>Optional.<br \/>\nSpecify the department of the devices.<\/td>\n<\/tr>\n<tr>\n<td>Device_Notes<\/td>\n<td>Character<\/td>\n<td>Optional.<br \/>\nSpecify the device notes to be added to the devices.<\/td>\n<\/tr>\n<tr>\n<td>Description<\/td>\n<td>Character<\/td>\n<td>Optional.<br \/>\nSpecify the description of the devices.<\/td>\n<\/tr>\n<tr>\n<td>Ownership<\/td>\n<td>Integer<\/td>\n<td>Optional.<br \/>\nSpecify the ownership of the devices. Choose <b>1 for Personal<\/b> and <b>2 for Corporate<\/b>.<\/td>\n<\/tr>\n<tr>\n<td>Device_name_append_number<\/td>\n<td>Boolean<\/td>\n<td>Optional.<br \/>\nIf set true, append number is added to device name.<\/td>\n<\/tr>\n<tr>\n<td>Asset_tag_append_number<\/td>\n<td>Boolean<\/td>\n<td>Optional.<br \/>\nIf set true, append number is added to asset tag.<\/td>\n<\/tr>\n<tr>\n<td>Department_append_number<\/td>\n<td>Boolean<\/td>\n<td>Optional.<br \/>\nIf set true, append number is added to department.<\/td>\n<\/tr>\n<tr>\n<td>Asset_tag_starting_number<\/td>\n<td>Integer<\/td>\n<td>Mandatory when <b>Asset_tag_append_number<\/b> is set true.<br \/>\nSpecify the starting number.<\/td>\n<\/tr>\n<tr>\n<td>Department_starting_number<\/td>\n<td>Integer<\/td>\n<td>Mandatory when <b>Depatment_append_number<\/b> is set true.<br \/>\nSpecify the starting number.<\/td>\n<\/tr>\n<tr>\n<td>Device_name_starting_number<\/td>\n<td>Integer<\/td>\n<td>Mandatory when <b>Device_name_append_number<\/b> is set true.<br \/>\nSpecify the starting number.<\/td>\n<\/tr>\n<tr>\n<td>Use_suffix_for_DeviceNotes<\/td>\n<td>Boolean<\/td>\n<td>Optional.<br \/>\nIf set true, suffix will be added to device notes.<\/td>\n<\/tr>\n<tr>\n<td>Use_suffix_for_Description<\/td>\n<td>Boolean<\/td>\n<td>Optional.<br \/>\nIf set true, suffix will be added to description.<\/td>\n<\/tr>\n<tr>\n<td>Suffix_devicenotes<\/td>\n<td>Integer<\/td>\n<td>Mandatory when <b>Use_suffix_for_DeviceNotes<\/b> is set to true.<br \/>\nSpecify the starting number of the suffix.<\/td>\n<\/tr>\n<tr>\n<td>Suffix_description<\/td>\n<td>Integer<\/td>\n<td>Mandatory when <b>Use_suffix_for_Description<\/b> is set to true.<br \/>\nSpecify the starting number of the suffix.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p><ln>If Update_single_device is set true, specify the following parameters.<\/ln><\/p>\n<div class=\"table-responsive\">\n<table id=\"table_61516733\" class=\"table table-bordered\" width=\"100%\">\n<thead>\n<tr>\n<th width=\"15%\"><strong>Argument<\/strong><\/th>\n<th width=\"12%\"><strong>Type<\/strong><\/th>\n<th width=\"30%\"><strong>Description<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>deviceID<\/td>\n<td>Integer<\/td>\n<td>Mandatory.<br \/>\nSpecify the Device ID of the device.<\/td>\n<\/tr>\n<tr>\n<td>device_name<\/td>\n<td>Character<\/td>\n<td>Optional.<br \/>\nSpecify the device name of the device.<\/td>\n<tr>\n<td>asset_tag<\/td>\n<td>Character<\/td>\n<td>Optional.<br \/>\nSpecify the asset tag of the device.<\/td>\n<\/tr>\n<tr>\n<td>department<\/td>\n<td>Character<\/td>\n<td>Optional.<br \/>\nSpecify the department of the device.<\/td>\n<\/tr>\n<tr>\n<td>device_notes<\/td>\n<td>Character<\/td>\n<td>Optional.<br \/>\nSpecify the device notes to be added to the device.<\/td>\n<\/tr>\n<tr>\n<td>description<\/td>\n<td>Character<\/td>\n<td>Optional.<br \/>\nSpecify the description of the device.<\/td>\n<\/tr>\n<tr>\n<td>ownership<\/td>\n<td>Integer<\/td>\n<td>Optional.<br \/>\nSpecify the ownership of the device. Choose <b>1 for Personal<\/b> and <b>2 for Corporate<\/b>.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"method-example\">\n<div class=\"curl-text\">curl<\/div>\n<div class=\"code-curl code-div active-code\">\n<div class=\"method-example-part\">\n<p>HTTP Request:<\/p>\n<pre class=\"lang:default decode:true\">POST https:\/\/<portal>.hexnodemdm.com\/api\/v1\/devices\/\r\nheaders:-\r\nAuthorization: <api key>\r\nContent-Type: application\/json\r\nSample Post Data:-\r\n[{\r\n\"Update_in_bulk\": true ,\r\n\"Update_single_device\": false,\r\n\"Device_ID\":[1,2],\r\n\"Device_name \":\"name\", \r\n\"Asset_Tag\": \"tag\", \r\n\"Department\": \"dept\", \r\n\"Device_Notes\":\"notes\", \r\n\"Ownership\": 1, \r\n\"Device_name_append_number\":false, \r\n\"Asset_tag_append_number\":false, \r\n\"Use_suffix_for_DeviceNotes\":false, \r\n\"Use_suffix_for_Description\": false,\r\n}] \r\n\r\n\r\nPOST https:\/\/<portal>.hexnodemdm.com\/api\/v1\/devices\/\r\nAuthorization: api key\r\nContent-Type: application\/json\r\nSample Post Data:-\r\n{\r\n\"Update_in_bulk\": false ,\r\n\"Update_single_device\": true,\r\n\"devicedata\":[ \r\n   { \"deviceID\":1,\r\n     \"device_name \":\"name\", \r\n     \"asset_tag\": \"tag\", \r\n     \"department\": \"dept\", \r\n     \"device_notes\":\"notes\", \r\n     \"ownership\": 1, \r\n     \"description\": \"des\"} ]\r\n}\r\n<\/pre>\n<p>Shell Command:<\/p>\n<pre class=\"lang:default decode:true \">curl -X POST -H 'Authorization: &lt;your API key&gt;' -H 'Content-Type: application\/json' -d \r\n'{\"Update_in_bulk\": false ,\"Update_single_device\": true,\"devicedata\":[ \r\n{ \"deviceID\":1,\"device_name \":\"name\", \"asset_tag\": \"tag\", \"department\": \"dept\", \"device_notes\":\"notes\", \r\n\"ownership\": 1, \"description\": \"des\"} ]}' https:\/\/<portal>.hexnodemdm.com\/api\/v1\/devices\/\r\n\r\ncurl -X POST -H 'Authorization:' -H 'Content-Type: application\/json' -d '{\"Update_in_bulk\": true ,\"Update_single_device\": false,\"Device_ID\":[1,2],\"Device_name \":\"name\", \"Asset_Tag\": \"tag\", \"Department\": \"dept\", \"Device_Notes\":\"notes\", \"Ownership\": 1, \"Device_name_append_number\":false, \"Asset_tag_append_number\":false, \"Use_suffix_for_DeviceNotes\":false, \"Use_suffix_for_Description\": false}' https:\/\/<portal>.hexnodemdm.com\/api\/v1\/devices\/\r\n<\/pre>\n<\/div>\n<\/div>\n<div class=\"code-curl code-div active-code\">\n<div class=\"method-example-part\">\n<p>HTTP Response:<\/p>\n<pre class=\"lang:default decode:true\">Device Name, Asset Tag, Department, Description, Device Notes, and Ownership changed successfully! \r\n<\/pre>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Edit Device Attribute Edit device attributes like Device Name, Description, Ownership and more for devices. Argument Type Description Update_in_bulk Boolean type Update attributes of devices in bulk. Update_single_device Boolean type Update attributes of a single device. Note: Please note that Update_in_bulk and Update_single_device can\u2019t be set true simultaneously. If Update_in_bulk is set to true, the [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":3698,"menu_order":3,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"class_list":["post-3520","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.hexnode.com\/mobile-device-management\/developers\/wp-json\/wp\/v2\/pages\/3520","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hexnode.com\/mobile-device-management\/developers\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.hexnode.com\/mobile-device-management\/developers\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.hexnode.com\/mobile-device-management\/developers\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hexnode.com\/mobile-device-management\/developers\/wp-json\/wp\/v2\/comments?post=3520"}],"version-history":[{"count":35,"href":"https:\/\/www.hexnode.com\/mobile-device-management\/developers\/wp-json\/wp\/v2\/pages\/3520\/revisions"}],"predecessor-version":[{"id":4224,"href":"https:\/\/www.hexnode.com\/mobile-device-management\/developers\/wp-json\/wp\/v2\/pages\/3520\/revisions\/4224"}],"up":[{"embeddable":true,"href":"https:\/\/www.hexnode.com\/mobile-device-management\/developers\/wp-json\/wp\/v2\/pages\/3698"}],"wp:attachment":[{"href":"https:\/\/www.hexnode.com\/mobile-device-management\/developers\/wp-json\/wp\/v2\/media?parent=3520"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}