To define basic information about a current event, use the <alert>
entity.
If an event occupies more than one ongoing location at the same time, it's
better to split the event into multiple alert
objects. For example, if a
forest fire spans multiple states, you can break up the alerts into multiple
alerts, one for each state. That way, you provide specific emergency
information to each state, and you update the fire situation more accurately.
If an event changes rapidly, like a hurricane that moves from east to west, then we recommend that you make periodic updates to the alert. Don't remove the existing alert from your feed. Instead, issue a new alert that refers to the previous alert.
Attributes
Table 1 describes the attribute value for the <alert>
entity:
Table 1. <alert>
entity attribute
Element name | Optionality | Type | Description |
---|---|---|---|
xmlns:cap |
REQUIRED | string |
The Example:
|
Elements
Table 2 describes the sub-element values for the <alert>
entity:
Table 2. <alert>
entity elements
Element name | Optionality | Type | CAP and Google notes and requirements |
---|---|---|---|
<identifier> |
REQUIRED | string |
Provide the ID of the alert that represents the event. The value of the
<identifier> element must be unique across all
events. |
<sender> |
REQUIRED | string |
The <sender> element identifies the originator of the
alert. It can't include spaces, commas, or restricted characters. |
<sent> |
REQUIRED | dateTime |
If the location cited in the When the content of a message applies across multiple time zones, use UTC times in preference to local times. |
<status> |
REQUIRED | AlertStatus |
Google only publishes publicly available alerts that have a
|
<msgType> |
REQUIRED | AlertMsgType |
An
For more information, see Event changes or expiration. |
<source> |
OPTIONAL | string |
The <source> element denotes the particular source of
the alert. An example is an operator or a specific device. |
<scope> |
REQUIRED | AlertScope |
The |
<restriction> |
CONDITIONAL | string |
If the <scope> element value is
Restricted , then the <restriction> element
is required. This element describes the rule to limit the distribution of
the restricted alert message. |
<addresses> |
CONDITIONAL | string |
If the <scope> element value is Private ,
then the <addresses> element is required. This element
lists the intended recipient of the alert message. You can include multiple
space-delimited addresses, but you must enclose addresses that include
whitespace in double quotes. |
<code> |
OPTIONAL | string |
The |
<note> |
CONDITIONAL | string |
If the alert contains either of the following element values, then the
|
<references> |
CONDITIONAL | string |
If the When your system republishes CAP content from another publisher,
include the full CAP alert. To link edited content to the original
source, use the If you reference multiple messages, then use whitespace as a delimiter. |
<incidents> |
OPTIONAL | string |
The <incidents> element collates multiple messages
that refer to different aspects of the same incident. |
<info> |
REQUIRED* |
info |
At least one <info> element must be present. Multiple
<info> blocks must all have the same
<category> and <event> element
values. |
* Google requires elements that have a bold and red REQUIRED optionality, but those elements are optional in the CAP standard.
Example
<alert xmlns="urn:oasis:names:tc:emergency:cap:1.1">
<identifier>AL20110412020900TornadoWarning</identifier>
<sender>w-nws.webmaster@noaa.gov</sender>
<sent>2011-04-11T21:18:07-05:00</sent>
<status>Actual</status>
<msgType>Alert</msgType>
<scope>Public</scope>
<info>
<language>en-US</language>
<category>Met</category>
<event>Tornado Warning</event>
<urgency>Immediate</urgency>
<severity>Extreme</severity>
<certainty>Observed</certainty>
<effective>2011-04-11T21:09:00-05:00</effective>
<expires>2011-04-11T21:30:00-05:00</expires>
<headline>Tornado Warning issued April 11 at
9:30PM CDT by NWS Birmingham</headline>
<description>Tornado is observed near Cleburne.</description>
<instruction>
Don't wait to see or hear the tornado.
For your protection, move to an interior room on the lowest floor
of your home or business.</instruction>
<area>
<areaDesc>Cleburne</areaDesc>
<polygon>33.61,-85.58 33.65,-85.58 33.72,-85.58
33.81,-85.36 33.7,-85.34 33.7,-85.33 33.68,-85.33
33.61,-85.58</polygon>
</area>
</info>
</alert>