Eine Liste von Warnungen anhand von Parametern abrufen
This API allows retrieving a list of alerts using parameters.
Anfrage
GET /api/v2/alerts?clientID={clientID}&facilityID={facilityID}&deviceID={deviceID}&endpointID={endpointID}&maxCount={maxCount} HTTP/1.1
Host: gear.cloud.studio
Authorization: Bearer {accessToken}Parameter
| Name | Description |
|---|---|
| accessToken | Access token with permissions to read alert information. See this page for more information. The access token can also be sent as part of the query string, using the "accessToken" parameter. |
| clientID | Optional identifier indicating that only alerts for the given client should be retrieved. |
| facilityID | Optional identifier indicating that only alerts for the given facility should be retrieved. |
| deviceID | Optional identifier indicating that only alerts for the given device should be retrieved. |
| endpointID | Optional identifier indicating that only alerts for the given endpoint should be retrieved. |
| maxCount | Optional parameter indicating the maximum number of alerts to include in the result. |
| It is mandatory to include one (and only one) of the parameters "clientID", "facilityID", "deviceID", or "endpointID". |
|---|
Antwort
Die Antwort enthält die Liste der passenden Warnungen, wie in diesem Beispiel gezeigt:
[
{
"AlertID": 211,
"VariableTypeID": 1,
"EndpointID": 114092,
"ConditionType": 3,
"Threshold": 25,
"ClientID": 4,
"FacilityID": 184,
"NormalConditionType": 6,
"NormalThreshold": 24,
"MinimumDurationSeconds": 300,
"NotificationEmails": ["someone@somewhere.com"],
"NotificationSMSNumbers": ["+1123456789"],
"NotificationVoiceNumbers": ["+1123456789"],
"Tags": ["default", "gateway-default"],
"SequenceNumber": 45701485,
"Enabled": true,
"Schedules": [],
"Timezone": {
"CurrentOffsetMinutes": -180,
"TimeZoneCode": "america/argentina/buenos_aires"
}
},
{
"AlertID": 212,
"VariableTypeID": 1,
"EndpointID": 114092,
"ConditionType": 5,
"Threshold": 20,
"ClientID": 4,
"FacilityID": 184,
"NormalConditionType": 3,
"NormalThreshold": 22,
"MinimumDurationSeconds": 300,
"NotificationEmails": ["someone@somewhere.com"],
"NotificationSMSNumbers": ["+1123456789"],
"NotificationVoiceNumbers": ["+1123456789"],
"Tags": ["default", "gateway-default"],
"SequenceNumber": 45701485,
"Enabled": true,
"Schedules": [
{
"Days": [
1,
2,
4,
5
],
"StartTime": {
"Hour": 0,
"Millisecond": 0,
"Minute": 0,
"Second": 0
},
"EndTime": {
"Hour": 23,
"Millisecond": 999,
"Minute": 0,
"Second": 59
}
}
],
"Timezone": {
"CurrentOffsetMinutes": -180,
"TimeZoneCode": "america/argentina/buenos_aires"
}
}
]Eine Benachrichtigung anhand ihrer ID abrufen
Diese API ermöglicht das Abrufen einer Benachrichtigung anhand ihrer ID. Anfrage GET /api/v2/alerts/{alertID} HTTP/1.1 Host: gear.cloud.studio Authorization: Bearer {accessToken}...
Eine Liste von Benachrichtigungen inkrementell abrufen
Diese API ermöglicht das inkrementelle Abrufen einer Liste von Benachrichtigungen. Dies ermöglicht schnelle Aktualisierungen von Benachrichtigungen, während sie erstellt, geändert oder gelöscht werden, ohne die vollständige Liste abrufen zu müssen.