Skip to main content

GetSecurityScore

Calculate and return the OPSWAT Security Score for the device.

Syntax​

Method ID​

#define WAAPI_MID_GET_SECURITY_SCORE 111

JSON Input Structure​

{
"input": {
"method": 111,
"force_refresh": boolean
}
}

Input Properties​

ParameterTypeDescription
force_refreshboolean(optional) If true, refresh the cached security status by making appropriate API calls. If false, use cached values.

JSON Output Structure​

{
"result": {
"method": 111,
"code": number,
"timing": number,
"timestamp": string,
"total_score": number,
"score_status": string,
"categories": [
{
"name": string,
"score": number,
"max_score": number,
"status": string,
"details": object
},
...
],
"last_refresh_time": number,
"cache_valid": boolean
}
}

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.total_scorenumberThe total security score (0-100).
result.score_statusstringOverall score status: 'good', 'warning', or 'poor'.
result.categoriesarray<object>Array of security score categories with their individual scores.
result.categories.namestringCategory name (anti_malware, antiphishing, patch_management, vulnerabilities, encryption, firewall, backup, unwanted_apps).
result.categories.scorenumberCurrent score for this category.
result.categories.max_scorenumberMaximum possible score for this category.
result.categories.statusstringCategory status: 'good', 'warning', or 'poor'.
result.categories.detailsobject(optional) Category-specific diagnostics (for example detected products, deductions, counters, or status notes). The shape varies per category.
result.last_refresh_timenumberTimestamp of last refresh in UNIX Epoch time.
result.cache_validbooleanWhether the cached data is valid.

Result Codes​

CodeNameDescription
0WAAPI_OKThe operation completed successfully.
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