: Get the Device Inventory
Focus
Focus

Get the Device Inventory

Table of Contents

Get the Device Inventory

Use the IoT Security API to get a list of all the devices in your inventory.

Synopsis

URI/pub/v4.0/device/list
HTTP MethodGET
FQDN<customer-name>.iot.paloaltonetworks.com

Description

Get a list of all the devices in your IoT Security inventory.

Request Fields

The URL of this request contains the following parameters:
FieldDescription
customerid
(Required) The customer ID specifies the API call for a specific tenant.
The following value is a string.
For other parameters you can include in the URL—such as offset, pagelength, sortdirection, sortfield and stime—see the general parameters and device-specific parameters described in Get Started with the IoT Security API. You can also use queries from the IoT Security portal to customize which devices are retrieved.
Request Example
curl --location -X GET 'https://acmecorp.iot.paloaltonetworks.com/pub/v4.0/device/list?customerid=acmecorp' \ -H 'X-Key-Id: KEY_ID' \ -H 'X-Access-Key: ACCESS_KEY'

Success Response

Upon success, the HTTP response code is 200. In addition, this API returns a JSON object containing devices and their attributes.
FieldDescription
totalThe number of devices matching the request
devicesAn array containing device details
deviceidThe device ID, which IoT Security uses to identify and track a device (string)
hostnameDevice hostname (string)
categoryCategory to which a device belongs (string)
profileDevice profile assigned to a device (string)
profile_typeType of device profile, such as IoT or Non_IoT (string)
profile_verticalIndustry vertical for a device profile such as Medical, IT Devices, and Office (string)
ip_addressIP address of a device (string)
mac_addressMAC address of a device (string)
risk_scoreRisk score of a device (integer)
risk_levelRisk level of a device; there are four: low, medium, high, and critical (string)
last_activityUTC timestamp for the last detected device activity (object)
confidence_scoreConfidence score for device classification (integer)
trafficRestrictedWhether traffic restriction is being applied to a device (yes) or not (no)
tagIdListA list of IDs for user- and system-defined tags assigned to a device
allTagsAn array of user-defined tags assigned to a device. Each item in the array consists of three attributes: tagType, tagValue, and tagId.
tagTypeThe key for a user-defined tag
tagValueThe value of the key for a user-defined tag
tagIdThe ID of a user-defined tag
totalThe total number of devices for which information was returned
To get more attributes for each device, include detail=true in the request. See Device-specific parameters in Get Started with the IoT Security API.
Success Response Example
{ "devices": [ { "deviceid": "34:02:86:44:65:36", "hostname": "InfusionPump-20", "last_activity": "2018-05-31T18:39:37.404Z", "category": "Infusion System", "profile": "Sigma Spectrum Infusion System", "profile_type": "IoT", "profile_vertical": "Medical", "ip_address": "192.168.10.121", "mac_address": "34:02:86:44:65:36", "risk_score": 0, "risk_level": "low", "confidence_score": 90}, "trafficRestricted": "no", "tagIdList": [ "60f221a219e22f10003a965e" ], "allTags": [ { "tagType": "med-equipment", "tagValue": "infusion", "tagId": "60f221a219e22f10003a965e" } ] } ... ], "total": 100 }
Data is shown for only the first of 100 devices in the full response, and detail mode is off.

Error Response

Upon error, the reply includes an HTTP response code, an error message, and additional information describing the error. The HTTP response code is one of the following:
FieldDescription
400Bad Request. This occurs when an HTTP request contains an invalid query string.
403Forbidden access. Either the provided API Key is invalid or it does not have the required RBAC permissions to run this API.
429Too many requests. The number of requests for the device inventory list exceeded the rate limit of 60 queries per minute per tenant.
500Internal server error. A unified status for API communication type errors.
Error Response Format
{code: STATUS_CODE, msg: GENERAL_MESSAGE}