About

Here you can find all published alerts. To get a description of the alert standard CAP (Common Alerting Protocol) se CAP.

NOTE: If there are no active alerts, you will get an empty object in the response.

GET /api/version/2/alerts.{ext}

Parameters

{ext} The suffix specifying which mediatype to use. See mediatypes for more information.

Area description

In every Alert there is an area element with an areaDesc element. The areaDesc value matches the id element in the district element in the published Districtviews.

CAP description

This is the most important objects you can find in every alert element.

Element with example Description
<identifier>smhi-bpm-1485090338327</identifier>
Each alert is given a unique id.
<sent>2017-01-22T14:20:21+01:00</sent>
The date and time when the alert was created.
<code>latest_update 2017-01-22T14:20:25+01:00</code>
The date and time of the latest update. This timestamp is set each time the alert is updated with new information.
<code>system_version 2</code>
The current version of this alert. The version is increased each time the alert is updated with new information.
<code>system_alert_category warning</code>
This can be either one of "warning", "risk" or "message":
The "warning" option shows that this alert is an actual warning.
The "risk" option is used when current weather situation can develop into a warning situation of class 2 or higher.
The "message" option is used when there is no general warning situation, but for certain target groups the alert can still have an impact that should be notified.
<event>heavy rain</event>
The actual type of the alert.
<eventCode>
  <valueName>system_event_sv-SE</valueName>
  <value>Stora regnmängder</value>
</eventCode>
The actual type of the alert, in Swedish.
<eventCode>
  <valueName>system_event_level</valueName>
  <value>Warning class 2 heavy rain</value>
</eventCode>
The classification of the event.
<eventCode>
  <valueName>system_event_level_sv-SE</valueName>
  <value>Varning klass 2</value>
</eventCode>
The classification of the event, in Swedish.
<eventCode>
  <valueName>system_event_level_color</valueName>
  <value>#ec9426</value>
</eventCode>
The color associated with the event class.
<headline>Västra Götaland</headline>
The headline.
<description>Mycket regn</description>
The description.
<area>
  <areaDesc>027</areaDesc>
</area>
One or several (comma separated) district id:s showing which warning district(s) that is affected by the alert.

Examples

Example request and response for the /api/alerts level in different mediatypes. This response in not complete for the sake of readability.

GET /api/version/2/alerts

or

GET /api/version/2/alerts.xml
...

GET /api/version/2/alerts.json
...