GetOSInfo
Will return information about local operating system (name, version, etc.).
Syntax
Method ID
#define WAAPI_MID_GET_OS_INFO 1
JSON Input Structure
{
"input": {
"method": 1
}
}
Input Properties
This method does not require any additional parameters beyond the method ID.
JSON Output Structure
{
"result": {
"method": 1,
"code": number,
"timing": number,
"timestamp": string,
"name": string,
"version": string,
"architecture": string,
"service_pack": string,
"os_type": number,
"os_id": number,
"details": {
"compatibility_mode_detected": boolean,
"computer_type": string,
"os_language": string,
"os_architecture": string,
"domain": string,
"netbios_name": string,
"host_name": string,
"windows_event_forwarding": boolean,
"product_type": string,
"esu_status": string
},
"build_version": string,
"build": string,
"start_date": number,
"end_date": number
}
}
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.name | string | The operating system name. |
result.version | string | The operating system version in this format: 'major.minor.buildNo'. |
result.architecture | string | The operating system architecture: '32-bit', '64-bit' |
result.service_pack | string | (optional) The operating system service pack info in this format: 'major.minor'. |
result.os_type | number | The operating system type: 1 - Windows, 2 - Linux, 4 - Mac. |
result.os_id | number | The operating system id. These are unique IDs that identify supported OS versions across different platforms. The detailed list of IDs and supported OS versions can be found in <platform>_OS_Support_Chart_Mapping.xml |
result.details | object | A collection (map) of additional OS attributes. |
result.details.compatibility_mode_detected | boolean | (optional) (Windows only) True if agent is running in compatibility mode, otherwise false. |
result.details.computer_type | string | Local hardware type: 'desktop', 'laptop', 'server', 'appliance', 'unknown'. |
result.details.os_language | string | The operating system language identifier. |
result.details.os_architecture | string | (optional) The operating system architecture: '32-bit', '64-bit', 'ARM processor', 'ARM 64-bit processor', 'x86_64', 'Unknown' |
result.details.domain | string | (optional) The computer domain name. |
result.details.netbios_name | string | (optional) (Windows only) The NetBIOS name of system. |
result.details.host_name | string | (optional) (macOS only) The hostname of system. Provided the short version of hostname without the domain. Valid characters for hostname are ASCII(7) letters from a to z, the digits from 0 to 9, and the hyphen (-). A hostname may not start with a hyphen. NOTE: on macOS X, hostname may be different with computer name |
result.details.windows_event_forwarding | boolean | (optional) (Windows only) True if the forwarder has successfully connected to the subscription manager that are configured for event forwarding, otherwise false. |
result.details.product_type | string | (optional) (Windows only) Identifies the Windows operating system's role. Possible values are workstation, server, domain_controller or unknown. |
result.details.esu_status | string | (optional) (Windows only) Indicate the current status of the Extended Security Updates (ESU) on a Windows machine. If no clue related to ESU enrollment, this field will be omitted. • enrolled: The machine has been enrolled in ESU program.• not_enrolled: The machine is not enrolled in ESU program.• unknown: The SDK cannot retrieve the current ESU program's status of the machine. |
result.build_version | string | (optional) (Windows only) Retrieve the 'Version' information from Windows specifications. |
result.build | string | (optional) (Windows only) Retrieve the 'OS build' information from Windows specifications. |
result.start_date | number | (optional) The operating system release date in UNIX Epoch time. |
result.end_date | number | (optional) The operating system end of life in UNIX Epoch time. |
Result Codes
GetOSInfo itself always succeeds once dispatched: every non-zero code below is produced by the shared invoke pipeline before the handler runs (input validation, initialization state, licensing).
| Code | Name | Description |
|---|---|---|
| 0 | WAAPI_OK | The operation completed successfully. Fields that could not be resolved contain placeholder values (see Remarks). |
| -5 | WAAPI_ERROR_NOT_INITIALIZED | This method was called while the SDK is not initialized. Call wa_api_setup and verify it returned a success code before invoking this method, and do not invoke it after wa_api_teardown. |
| -7 | WAAPI_ERROR_COMPONENT_NOT_LICENSED | The license does not include the Detection component, or the license does not permit the current mode (online vs. offline). |
| -8 | WAAPI_ERROR_COMPONENT_LICENSE_EXPIRED | The Detection component license has expired. |
| -20 | WAAPI_ERROR_INVALID_INPUT_ARGS | The input.method field is missing from the invoke request. |
| -21 | WAAPI_ERROR_INVALID_JSON | The input passed to wa_api_invoke is not parseable JSON. |
| -26 | WAAPI_ERROR_DISPATCH_EXCEPTION | An internal exception escaped while dispatching the request. This is a defensive guard and is not expected during normal operation. |
| -66 | WAAPI_ERROR_TEARDOWN_BUSY | The method was invoked while wa_api_teardown was already in progress. Note that the json_out body embeds "error": {"code": -5} while the function return value is -66. |
| -69 | WAAPI_ERROR_MEMORY_CORUPTED | The memory has been corrupted. Please restart the process to recover the SDK. This is a defensive guard and is not expected during normal operation. |
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.
Best-effort field resolution
GetOSInfo is a best-effort query. When an individual field cannot be resolved, the call still returns WAAPI_OK and the field is either omitted or filled with a fixed placeholder string instead of failing the request. Placeholder text and casing are defined per field and per platform, and string comparisons are case-sensitive — match the exact literal for the specific field and platform you are reading. Each field is independent: one field carrying a placeholder says nothing about the value of any other field.
| Field | Windows | macOS | Linux |
|---|---|---|---|
computer_type | unknown (all lowercase) | unknown (all lowercase) | unknown (all lowercase) |
os_architecture | Unknown (capital U); empty string if the system query fails entirely | raw hardware token (for example x86_64, arm64), or empty string — never Unknown | Unknown (capital U) |
os_language | empty, or the field is omitted — not the word "unknown" | unknown (all lowercase) | empty string — not the word "unknown" |
esu_status | unknown (all lowercase); omitted when no ESU signal is found | not returned on this platform | not returned on this platform |
Licensing
GetOSInfo is licensed under the Detection component. Calls fail with licensing errors (see Result Codes) when the license does not cover Detection, has expired, or does not permit the SDK's current online/offline mode.
Examples
Examples will be added here demonstrating the usage of this method.
See Also
Last updated: 2026-10-01