{"id":349,"date":"2024-03-14T10:49:23","date_gmt":"2024-03-14T09:49:23","guid":{"rendered":"https:\/\/kb.apptec360.com\/manual\/?post_type=knowledgebase&#038;p=349"},"modified":"2024-04-01T07:33:13","modified_gmt":"2024-04-01T05:33:13","slug":"queries","status":"publish","type":"knowledgebase","link":"https:\/\/kb.apptec360.com\/manual\/knowledgebase\/general-settings\/role-based-access\/api-access\/queries\/","title":{"rendered":"Queries"},"content":{"rendered":"\n<p><strong><span style=\"text-decoration: underline;\">List all devices<\/span><\/strong><\/p>\n\n\n\n<p>Functionality: Returns a list of all devices containing the Device ID, IMEI and Serial<br>API URI: v2\/device\/listdevices<br>Mandatory Parameters: none<br>Optional Parameters: none<\/p>\n\n\n\n<p><span style=\"text-decoration: underline;\">Example Request Body<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n\"api\": \"v2\/device\/listdevices\",\n\"time\": 1529662725\n}\n<\/code><\/pre>\n\n\n\n<p><span style=\"text-decoration: underline;\">Example Response Body<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n\"errors\": &#91;],\n\"list\":&#91;\n{ \"id\":\"10\",\"serial\":\"987612345\",\"imei\":\"899938455454\"},\n{ \"id\":\"11\",\"serial\":\"619723118\",\"imei\":\"713032378599\"}\n]\n}\n<\/code><\/pre>\n\n\n\n<div class=\"pagebreak-after\"><\/div>\n\n\n\n<p><strong><span style=\"text-decoration: underline;\">Get list of (GPS) positions<\/span><\/strong><\/p>\n\n\n\n<p>Functionality: Returns a list of all stored position log entries for device ids<br>API URI: v2\/device\/listposition<br>Mandatory Parameters: \u201cids\u201d \u2013 Array of Device IDs<br>Optional Parameters: none<\/p>\n\n\n\n<p><span style=\"text-decoration: underline;\">Example Request Body<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{<br>\"api\": \"device\/listposition\",<br>\"params\": {<br>\"ids\": &#91;10, 11]<br>},<br>\"time\": 1529662725<br>}<\/code><\/pre>\n\n\n\n<p><span style=\"text-decoration: underline;\">Example Response Body<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{<br>\"errors\": &#91;],<br>\"list\":&#91;<br>\"10\":&#91;<br>{\"time\":\"1529632725\",\"pos\":\"47.5572,7.5967\"},<br>{\"time\":\"1529642725\",\"pos\":\"47.5572,7.5968\"},<br>{\"time\":\"1529652725\",\"pos\":\"47.5573,7.5969\"},<br>],<br>\"88\":&#91;],<br>]<br>}<\/code><\/pre>\n\n\n\n<div class=\"pagebreak-after\"><\/div>\n\n\n\n<p><strong><span style=\"text-decoration: underline;\">Get asset map<\/span><\/strong><\/p>\n\n\n\n<p>Functionality:<br>Returns a list of all stored possible assets to be requested using Get any asset data.<br>You can either use the human readable form or the asset tag to request the data.<br>API URI: v2\/device\/getassetmap<br>Mandatory Parameters: none<br>Optional Parameters: none<\/p>\n\n\n\n<p><span style=\"text-decoration: underline;\">Example Request Body<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{<br>\"api\": \"v2\/device\/getassetmap\",<br>\"time\": 1529662725<br>}<\/code><\/pre>\n\n\n\n<p><span style=\"text-decoration: underline;\">Example Response Body<\/span><\/p>\n\n\n\n<p>This response was shortened for readability.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{<br>\"AssetKeys\": {<br>\"UDID\": \"AT001\",<br>\"Device Alias\": \"AT002\",<br>\"OS Version WinMobile iOS MacOS\": \"AT003\",<br>\"Model Name\": \"AT004\",<br>\"Serial Number\": \"AT005\",<br>\"Total Storage\": \"AT006\",<br>\"Free Storage\": \"AT007\",<br>\"IMEI\": \"AT008\",<br>\u2026<br>\"apptecID\": \"APPTECID\"<br>},<br>\"errors\": &#91;]<br>}<\/code><\/pre>\n\n\n\n<div class=\"pagebreak-after\"><\/div>\n\n\n\n<p><strong><span style=\"text-decoration: underline;\">Get any asset data<\/span><\/strong><\/p>\n\n\n\n<p>Functionality: Returns a list of requested asset data for device ids<br>API URI: v2\/device\/getassetdata<br>Mandatory Parameters: \u201cids\u201d \u2013 Array of Device IDs<br>Optional Parameters:<br>\u201cassetkeys\u201d \u2013 Asset data keys to return. If not specified all available asset data will be<br>returned. You can get a list of asset keys using Get asset map.<\/p>\n\n\n\n<p><span style=\"text-decoration: underline;\">Example Request Body<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{<br>\"api\": \"v2\/device\/getassetdata\",<br>\"time\": 1529662725,<br>\"params\": {<br>\"ids\": &#91;<br>26<br>],<br>\"assetkeys\": &#91;<br>\"imei\"<br>]<br>}<br>}<\/code><\/pre>\n\n\n\n<p><span style=\"text-decoration: underline;\">Example Response Body<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{<br>\"result\": {<br>\"26\": {<br>\"imei\": \"349157642516427\u201d<br>}<br>},<br>\"errors\": &#91;]<br>}<\/code><\/pre>\n\n\n\n<div class=\"pagebreak-after\"><\/div>\n","protected":false},"parent":336,"menu_order":0,"template":"","class_list":["post-349","knowledgebase","type-knowledgebase","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/kb.apptec360.com\/manual\/wp-json\/wp\/v2\/knowledgebase\/349","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kb.apptec360.com\/manual\/wp-json\/wp\/v2\/knowledgebase"}],"about":[{"href":"https:\/\/kb.apptec360.com\/manual\/wp-json\/wp\/v2\/types\/knowledgebase"}],"version-history":[{"count":6,"href":"https:\/\/kb.apptec360.com\/manual\/wp-json\/wp\/v2\/knowledgebase\/349\/revisions"}],"predecessor-version":[{"id":3268,"href":"https:\/\/kb.apptec360.com\/manual\/wp-json\/wp\/v2\/knowledgebase\/349\/revisions\/3268"}],"up":[{"embeddable":true,"href":"https:\/\/kb.apptec360.com\/manual\/wp-json\/wp\/v2\/knowledgebase\/336"}],"wp:attachment":[{"href":"https:\/\/kb.apptec360.com\/manual\/wp-json\/wp\/v2\/media?parent=349"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}