Skip to content

Query asset alerts

GET /asset/<assetId>/alerts?fields=...

Description

Query all open alerts for a given asset.

With the current API it is not possible to query for closed alerts, except when you have an explicit alert 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 alert.
message string Initial message when the alert was opened.
severity integer Initial severity when the alert was opened (value between 0=highest and 7=lowest severity).
timestamp integer Unix timestamp in seconds when the alert was opened.
lastMessage string Message of the last hit (equal to "message" with only a single hit).
lastSeverity integer Severity of the last hit (equal to "severity" with only a single hit).
lastTimestamp integer Unix timestamp in seconds of the last hit (equal to "timestamp" with only a single hit).
ownerId integer/null User Id of the owner or null when the alert is not assigned to an owner.

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/alerts?fields=ks,message,severity,ownerId' \
    -H 'Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'

Response:

[
    {
        "ks": "<a-unique-key-string>",
        "message": "Initial message of the alert",
        "severity": 3,
        "ownerId": null
    }
]