Skip to main content

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​

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.namestringThe operating system name.
result.versionstringThe operating system version in this format: 'major.minor.buildNo'.
result.architecturestringThe operating system architecture: '32-bit', '64-bit'
result.service_packstring(optional) The operating system service pack info in this format: 'major.minor'.
result.os_typenumberThe operating system type: 1 - Windows, 2 - Linux, 4 - Mac.
result.os_idnumberThe 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.detailsobjectA collection (map) of additional OS attributes.
result.details.compatibility_mode_detectedboolean(optional) (Windows only) True if agent is running in compatibility mode, otherwise false.
result.details.computer_typestringLocal hardware type: 'desktop', 'laptop', 'server', 'appliance', 'unknown'.
result.details.os_languagestringThe operating system language identifier.
result.details.os_architecturestring(optional) The operating system architecture: '32-bit', '64-bit', 'ARM processor', 'ARM 64-bit processor', 'x86_64', 'Unknown'
result.details.domainstring(optional) The computer domain name.
result.details.netbios_namestring(optional) (Windows only) The NetBIOS name of system.
result.details.host_namestring(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_forwardingboolean(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_typestring(optional) (Windows only) Identifies the Windows operating system's role. Possible values are workstation, server, domain_controller or unknown.
result.details.esu_statusstring(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_versionstring(optional) (Windows only) Retrieve the 'Version' information from Windows specifications.
result.buildstring(optional) (Windows only) Retrieve the 'OS build' information from Windows specifications.
result.start_datenumber(optional) The operating system release date in UNIX Epoch time.
result.end_datenumber(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).

CodeNameDescription
0WAAPI_OKThe operation completed successfully. Fields that could not be resolved contain placeholder values (see Remarks).
-5WAAPI_ERROR_NOT_INITIALIZEDThis 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.
-7WAAPI_ERROR_COMPONENT_NOT_LICENSEDThe license does not include the Detection component, or the license does not permit the current mode (online vs. offline).
-8WAAPI_ERROR_COMPONENT_LICENSE_EXPIREDThe Detection component license has expired.
-20WAAPI_ERROR_INVALID_INPUT_ARGSThe input.method field is missing from the invoke request.
-21WAAPI_ERROR_INVALID_JSONThe input passed to wa_api_invoke is not parseable JSON.
-26WAAPI_ERROR_DISPATCH_EXCEPTIONAn internal exception escaped while dispatching the request. This is a defensive guard and is not expected during normal operation.
-66WAAPI_ERROR_TEARDOWN_BUSYThe 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.
-69WAAPI_ERROR_MEMORY_CORUPTEDThe memory has been corrupted. Please restart the process to recover the SDK. This is a defensive guard and is not expected during normal operation.
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.

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.

FieldWindowsmacOSLinux
computer_typeunknown (all lowercase)unknown (all lowercase)unknown (all lowercase)
os_architectureUnknown (capital U); empty string if the system query fails entirelyraw hardware token (for example x86_64, arm64), or empty string — never UnknownUnknown (capital U)
os_languageempty, or the field is omitted — not the word "unknown"unknown (all lowercase)empty string — not the word "unknown"
esu_statusunknown (all lowercase); omitted when no ESU signal is foundnot returned on this platformnot 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