Document active alert filtering behavior
This commit is contained in:
10
docs/api.md
10
docs/api.md
@@ -194,10 +194,14 @@ GET /conditions/current?format=json&precision=0
|
||||
GET /alerts/active
|
||||
```
|
||||
|
||||
Returns the latest active-alert snapshot.
|
||||
Returns the latest stored alert run filtered to alerts active at request time.
|
||||
|
||||
Query parameters: `format`, `units`.
|
||||
|
||||
When no latest alert run exists, `data` is null. When a latest run exists but
|
||||
no alerts are currently active, `data` remains an object and `alerts` is an
|
||||
empty array.
|
||||
|
||||
Run `data` fields:
|
||||
|
||||
| Field | Type | Notes |
|
||||
@@ -207,6 +211,10 @@ Run `data` fields:
|
||||
| `latitude`, `longitude` | number | optional |
|
||||
| `alerts` | array | active alerts, possibly empty |
|
||||
|
||||
Alerts are active when `messageType` is not `Cancel`, `effective` is absent or
|
||||
at or before request time, and `expires` is absent or after request time.
|
||||
`onset` is presented when available but is not used as the active boundary.
|
||||
|
||||
Alert fields include `id`, `event`, `headline`, `severity`, `urgency`,
|
||||
`certainty`, `status`, `messageType`, `category`, `response`, `description`,
|
||||
`instruction`, `sent`, `effective`, `onset`, `expires`, `areaDescription`,
|
||||
|
||||
Reference in New Issue
Block a user