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
| Parameter | Type | Description |
|---|---|---|
force_refresh | boolean | (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
| 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.total_score | number | The total security score (0-100). |
result.score_status | string | Overall score status: 'good', 'warning', or 'poor'. |
result.categories | array<object> | Array of security score categories with their individual scores. |
result.categories.name | string | Category name (anti_malware, antiphishing, patch_management, vulnerabilities, encryption, firewall, backup, unwanted_apps). |
result.categories.score | number | Current score for this category. |
result.categories.max_score | number | Maximum possible score for this category. |
result.categories.status | string | Category status: 'good', 'warning', or 'poor'. |
result.categories.details | object | (optional) Category-specific diagnostics (for example detected products, deductions, counters, or status notes). The shape varies per category. |
result.last_refresh_time | number | Timestamp of last refresh in UNIX Epoch time. |
result.cache_valid | boolean | Whether the cached data is valid. |
Result Codes
| Code | Name | Description |
|---|---|---|
| 0 | WAAPI_OK | The 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