Skip to main content

CollectDeviceInventory

(Windows only) Collect endpoint inventory data used for driver/firmware patch matching and optionally export them to a JSON file.

Syntax​

Method ID​

#define WA_VMOD_COLLECT_DEVICE_INVENTORY 50901

JSON Input Structure​

{
"input": {
"method": 50901,
"output_file": string
}
}

Input Properties​

ParameterTypeDescription
output_filestring(optional) Desired path of the JSON file where the collected device inventory will be written. If omitted, the inventory is returned in the response only and is not persisted to disk. Accepts absolute paths (e.g., D:\inventory\output.json) or relative paths (e.g., output.json).

JSON Output Structure​

{
"result": {
"method": 50901,
"code": number,
"timing": number,
"timestamp": string,
"inventory_file": string,
"inventory_collection": {
"system": {
"vendor": string,
"system_family": string,
"system_product_name": string,
"system_sku": string,
"machine_type": string
},
"os": {
"os_name": string,
"os_version": string,
"architecture": string,
"build": string
},
"bios": {
"bios_vendor": string,
"bios_version": string,
"release_date": string
},
"devices": [
{
"name": string,
"device_id": string,
"class": string,
"hardware_ids": [
string,
...
],
"compatible_ids": [
string,
...
],
"enumerator": string,
"driver": {
"version": string,
"desc": string,
"date": string,
"inf_path": string,
"provider": string
},
"firmware": {
"version": string,
"resource_id": string,
"resource_type": number,
"resource_lowest_supported_version": string,
"resource_highest_supported_version": string
},
"is_present": boolean,
"reboot_required": boolean,
"safe_removal_required": boolean,
"removal_policy": number,
"first_install_date": string
},
...
]
}
}
}

Output Properties​

PropertyTypeDescription
result.methodnumberThe method ID that generated this result.
result.codenumberThe result code. See Result Codes.
result.timingnumberThe measured time for the method call in milliseconds.
result.timestampstringThe timestamp in seconds of when the call was made.
result.inventory_filestring(optional) Final path of the exported inventory JSON file. Only present if output_file was specified in the request.
result.inventory_collectionobjectCollected inventory grouped by section.
result.inventory_collection.systemobject(optional) System-level information.
result.inventory_collection.system.vendorstring(optional) System manufacturer name (e.g., "Dell Inc.", "Lenovo").
result.inventory_collection.system.system_familystring(optional) Product family name (e.g., "Latitude", "ThinkPad").
result.inventory_collection.system.system_product_namestring(optional) Full product model name (e.g., "Latitude 5520").
result.inventory_collection.system.system_skustring(optional) Machine SKU.
result.inventory_collection.system.machine_typestring(optional) Machine model identifier (a.k.a. Model Type).
result.inventory_collection.osobject(optional) Operating system information.
result.inventory_collection.os.os_namestring(optional) Operating system name (e.g., "Windows 11").
result.inventory_collection.os.os_versionstring(optional) OS version in major.minor.patch format (e.g., "10.0.22631").
result.inventory_collection.os.architecturestring(optional) OS architecture.
result.inventory_collection.os.buildstring(optional) Windows build number in build.fix format (e.g., "22631.1231").
result.inventory_collection.biosobject(optional) BIOS information.
result.inventory_collection.bios.bios_vendorstring(optional) BIOS manufacturer name (e.g., "Dell Inc.").
result.inventory_collection.bios.bios_versionstring(optional) BIOS version string (e.g., "1.23.0").
result.inventory_collection.bios.release_datestring(optional) BIOS release date in MM/DD/YYYY format (e.g., "01/15/2024").
result.inventory_collection.devicesarray<object>(optional) List of detected hardware devices.
result.inventory_collection.devices.namestring(optional) Device display name.
result.inventory_collection.devices.device_idstring(optional) Unique device instance identifier.
result.inventory_collection.devices.classstring(optional) Device setup class (e.g., "Display", "Net", "USB").
result.inventory_collection.devices.hardware_idsarray<string>(optional) Ordered list of hardware IDs used for driver/firmware matching.
result.inventory_collection.devices.compatible_idsarray<string>(optional) Ordered list of compatible IDs for broader fallback matching.
result.inventory_collection.devices.enumeratorstring(optional) Bus enumerator of the device (e.g., "PCI", "USB").
result.inventory_collection.devices.driverobject(optional) Currently installed driver information.
result.inventory_collection.devices.driver.versionstring(optional) Installed driver version (e.g., "27.20.100.9316").
result.inventory_collection.devices.driver.descstring(optional) Driver description.
result.inventory_collection.devices.driver.datestring(optional) Driver release date in MM/DD/YYYY format.
result.inventory_collection.devices.driver.inf_pathstring(optional) Path to the driver INF file on disk.
result.inventory_collection.devices.driver.providerstring(optional) Driver provider/publisher name (e.g., "Intel Corporation").
result.inventory_collection.devices.firmwareobject(optional) Firmware resource information.
result.inventory_collection.devices.firmware.versionstring(optional) Installed firmware version.
result.inventory_collection.devices.firmware.resource_idstring(optional) Firmware resource identifier.
result.inventory_collection.devices.firmware.resource_typenumber(optional) Firmware resource type code.
result.inventory_collection.devices.firmware.resource_lowest_supported_versionstring(optional) Minimum firmware version this resource supports updating from.
result.inventory_collection.devices.firmware.resource_highest_supported_versionstring(optional) Maximum firmware version this resource supports updating to.
result.inventory_collection.devices.is_presentboolean(optional) Whether the device is currently connected and present.
result.inventory_collection.devices.reboot_requiredboolean(optional) Whether a reboot is pending for this device.
result.inventory_collection.devices.safe_removal_requiredboolean(optional) Whether the device requires safe removal before disconnecting.
result.inventory_collection.devices.removal_policynumber(optional) Device removal policy code as reported by the OS.
result.inventory_collection.devices.first_install_datestring(optional) Date the device driver was first installed in MM/DD/YYYY format.

Result Codes​

CodeNameDescription
0WAAPI_OKInventory collected successfully.
-5WAAPI_ERROR_NOT_INITIALIZEDOESIS Framework has not been initialized yet (for example, because wa_api_setup was not called successfully or the license required by this module is missing).
-20WAAPI_ERROR_INVALID_INPUT_ARGSRequired field is missing or has unexpected type and/or value, or optional field exists but has unexpected type and/or value.
-22WAAPI_ERROR_ACCESS_DENIEDInsufficient permissions to collect inventory or write the output file.
-27WAAPI_ERROR_NATIVE_APIOS-level API call failed while enumerating devices or system info.
-28WAAPI_ERROR_NOT_FOUNDParent folder does not exist.
-1WAAPI_ERROR_GENERALUnexpected failure with no more specific error type.
note

Other codes may be returned. See the full Result Codes reference for the complete list.

Remarks​

Error Handling​

The results of this function are determined by the error code returned by the call. If successful, WAAPI_OK or a special success code will be returned. Always check both the function return value and the result.code field in the output JSON.

Examples​

Examples will be added here demonstrating the usage of this method.

See Also​


Last updated: 2026-10-01