Query notification
GET /notification/<notificationKs>?fields=...&actions=...
Description
Query notification details. This API call will work for both an open and closed notification.
Path parameters
| Param | Description |
|---|---|
notificationKs |
Notification key string (ks). |
Query parameters
| Param | Default | Description |
|---|---|---|
fields |
all fields | Fields to return (see Fields below for all available fields). |
Fields
| Field | Return type | Description |
|---|---|---|
ks |
string | Key string of the notification. |
message |
string | Notification message. |
severity |
integer | Notification severity (value between 0=highest and 2=lowest severity). |
timestamp |
integer | Unix timestamp in seconds when the notification was opened. |
lastTimestamp |
integer | Unix timestamp in seconds of the last hit (equal to "timestamp" with only a single hit). |
kind |
string | One of ConnectionStatus, ConnectionTimeDelta, ProbeVersion, ProbeMissing, ProbeTimeDelta, ProbeNoHeartbeat, CheckMissing, CheckError, CheckAged, CheckInvalidResult, CheckInvalidTimestamp, CheckInvalidData, ContainerMaintenance, AgentcoreMissing or ConditionError. |
status |
string | Notification status. One of Open, Closed or Resolved. |
hits |
integer | Number of consecutive hits. |
assetId |
integer/null | Id of the associated asset. Only applicable for CheckMissing, CheckError, CheckAged, CheckInvalidResult, CheckInvalidTimestamp or CheckInvalidData notifications. |
collector |
string/null | Key of the associated collector. Only applicable for CheckMissing, CheckError, CheckAged, CheckInvalidResult, CheckInvalidTimestamp or CheckInvalidData notifications. |
check |
string/null | Key of the associated check. Only applicable for CheckMissing, CheckError, CheckAged, CheckInvalidResult, CheckInvalidTimestamp or CheckInvalidData notifications. |
closedTimestamp |
integer/null | Unix timestamp in seconds when the notification was closed or null if not closed. |
closedBy |
integer/null | Id of the user who closed the notification or null if not closed. |
Return codes
| Error code | Reason |
|---|---|
200 |
Success. |
400 |
Unknown field or invalid notification key string. |
401 |
Invalid or missing token. |
403 |
Insufficient permissions (required: API+READ). |
404 |
Notification not found. |
Example
Curl request:
curl \
-X GET 'https://api.infrasonar.com/notification/xxx' \
-H 'Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
Response:
{
"ks": "<a-unique-key-string>",
"identifierId": 456,
"indexId": 42,
"kind": "CheckMissing",
"message": "Check is missing _(can happen if the check is new for this asset)_",
"severity": 2,
"timestamp": 1667511262,
"lastTimestamp": 1667511523,
"closedTimestamp": null,
"closedBy": null
}