alert

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 xmlns attribute must reference the CAP URN as the namespace.

Example:

<cap:alert xmlns:cap="urn:oasis:names:tc:emergency:cap:1.2"/>

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 <area> block falls within a single time zone, use the <sent> element to specify time in that zone. When applicable, include an allowance for Daylight Savings time.

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 <status> element value of Actual.

<msgType> REQUIRED AlertMsgType

An UPDATE or CANCEL <msgType> must include at least one <references> element. The CAP standard specifies the following:

  • Any alert message that updates a previous alert uses UPDATE and sets <references> element values to all previous messages that haven't reached their <expires> date.
  • The UPDATE or CANCEL <msgType> element must apply to a non-expired alert. Therefore, all related messages and unexpired alerts must be referenced when an UPDATE or CANCEL <msgType> is issued.

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 <scope> element denotes the intended distribution of the alert message.

<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 <code> element denotes special handling of the alert message.

<note> CONDITIONAL string

If the alert contains either of the following element values, then the <note> element is required:

  • <status>Exercise></status>
  • <msgType>Error></msgType>
<references> CONDITIONAL string

If the <msgType> element value is either UPDATE or CANCEL, then the <references> element is required.

When your system republishes CAP content from another publisher, include the full CAP alert. To link edited content to the original source, use the <references> tag.

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>