Query asset notifications
GET /asset/<assetId>/notifications?fields=...
Description
Query all open notifications for a given asset.
With the current API it is not possible to query for closed notifications, except when you have an explicit notification key string.
Path parameters
| Param | Description |
|---|---|
assetId |
Asset Id. |
Query parameters
| Param | Default | Description |
|---|---|---|
fields |
ks |
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 | CheckMissing, CheckError, CheckAged, CheckInvalidResult, CheckInvalidTimestamp or CheckInvalidData. |
status |
string | Notification status. One of Open, Closed or Resolved. |
hits |
integer | Number of consecutive hits. |
assetId |
integer | Id of the associated asset. |
collector |
string | Key of the associated collector. |
check |
string | Key of the associated check. |
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. |
401 |
Invalid or missing token. |
403 |
Insufficient permissions (required: API+READ). |
404 |
Asset not found. |
Example
Curl request:
curl \
-X GET 'https://api.infrasonar.com/asset/123/notifications?fields=ks,message,severity' \
-H 'Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
Response:
[
{
"ks": "<a-unique-key-string>",
"message": "Check is missing _(can happen if the check is new for this asset)_",
"severity": 2
}
]