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
| Parameter | Type | Description |
|---|---|---|
output_file | string | (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
| Property | Type | Description |
|---|---|---|
result.method | number | The method ID that generated this result. |
result.code | number | The result code. See Result Codes. |
result.timing | number | The measured time for the method call in milliseconds. |
result.timestamp | string | The timestamp in seconds of when the call was made. |
result.inventory_file | string | (optional) Final path of the exported inventory JSON file. Only present if output_file was specified in the request. |
result.inventory_collection | object | Collected inventory grouped by section. |
result.inventory_collection.system | object | (optional) System-level information. |
result.inventory_collection.system.vendor | string | (optional) System manufacturer name (e.g., "Dell Inc.", "Lenovo"). |
result.inventory_collection.system.system_family | string | (optional) Product family name (e.g., "Latitude", "ThinkPad"). |
result.inventory_collection.system.system_product_name | string | (optional) Full product model name (e.g., "Latitude 5520"). |
result.inventory_collection.system.system_sku | string | (optional) Machine SKU. |
result.inventory_collection.system.machine_type | string | (optional) Machine model identifier (a.k.a. Model Type). |
result.inventory_collection.os | object | (optional) Operating system information. |
result.inventory_collection.os.os_name | string | (optional) Operating system name (e.g., "Windows 11"). |
result.inventory_collection.os.os_version | string | (optional) OS version in major.minor.patch format (e.g., "10.0.22631"). |
result.inventory_collection.os.architecture | string | (optional) OS architecture. |
result.inventory_collection.os.build | string | (optional) Windows build number in build.fix format (e.g., "22631.1231"). |
result.inventory_collection.bios | object | (optional) BIOS information. |
result.inventory_collection.bios.bios_vendor | string | (optional) BIOS manufacturer name (e.g., "Dell Inc."). |
result.inventory_collection.bios.bios_version | string | (optional) BIOS version string (e.g., "1.23.0"). |
result.inventory_collection.bios.release_date | string | (optional) BIOS release date in MM/DD/YYYY format (e.g., "01/15/2024"). |
result.inventory_collection.devices | array<object> | (optional) List of detected hardware devices. |
result.inventory_collection.devices.name | string | (optional) Device display name. |
result.inventory_collection.devices.device_id | string | (optional) Unique device instance identifier. |
result.inventory_collection.devices.class | string | (optional) Device setup class (e.g., "Display", "Net", "USB"). |
result.inventory_collection.devices.hardware_ids | array<string> | (optional) Ordered list of hardware IDs used for driver/firmware matching. |
result.inventory_collection.devices.compatible_ids | array<string> | (optional) Ordered list of compatible IDs for broader fallback matching. |
result.inventory_collection.devices.enumerator | string | (optional) Bus enumerator of the device (e.g., "PCI", "USB"). |
result.inventory_collection.devices.driver | object | (optional) Currently installed driver information. |
result.inventory_collection.devices.driver.version | string | (optional) Installed driver version (e.g., "27.20.100.9316"). |
result.inventory_collection.devices.driver.desc | string | (optional) Driver description. |
result.inventory_collection.devices.driver.date | string | (optional) Driver release date in MM/DD/YYYY format. |
result.inventory_collection.devices.driver.inf_path | string | (optional) Path to the driver INF file on disk. |
result.inventory_collection.devices.driver.provider | string | (optional) Driver provider/publisher name (e.g., "Intel Corporation"). |
result.inventory_collection.devices.firmware | object | (optional) Firmware resource information. |
result.inventory_collection.devices.firmware.version | string | (optional) Installed firmware version. |
result.inventory_collection.devices.firmware.resource_id | string | (optional) Firmware resource identifier. |
result.inventory_collection.devices.firmware.resource_type | number | (optional) Firmware resource type code. |
result.inventory_collection.devices.firmware.resource_lowest_supported_version | string | (optional) Minimum firmware version this resource supports updating from. |
result.inventory_collection.devices.firmware.resource_highest_supported_version | string | (optional) Maximum firmware version this resource supports updating to. |
result.inventory_collection.devices.is_present | boolean | (optional) Whether the device is currently connected and present. |
result.inventory_collection.devices.reboot_required | boolean | (optional) Whether a reboot is pending for this device. |
result.inventory_collection.devices.safe_removal_required | boolean | (optional) Whether the device requires safe removal before disconnecting. |
result.inventory_collection.devices.removal_policy | number | (optional) Device removal policy code as reported by the OS. |
result.inventory_collection.devices.first_install_date | string | (optional) Date the device driver was first installed in MM/DD/YYYY format. |
Result Codes
| Code | Name | Description |
|---|---|---|
| 0 | WAAPI_OK | Inventory collected successfully. |
| -5 | WAAPI_ERROR_NOT_INITIALIZED | OESIS 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). |
| -20 | WAAPI_ERROR_INVALID_INPUT_ARGS | Required field is missing or has unexpected type and/or value, or optional field exists but has unexpected type and/or value. |
| -22 | WAAPI_ERROR_ACCESS_DENIED | Insufficient permissions to collect inventory or write the output file. |
| -27 | WAAPI_ERROR_NATIVE_API | OS-level API call failed while enumerating devices or system info. |
| -28 | WAAPI_ERROR_NOT_FOUND | Parent folder does not exist. |
| -1 | WAAPI_ERROR_GENERAL | Unexpected 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