Notification Endpoints
A notification endpoint is a URL that can accept CAP 1.2 formatted XML. This public standard is documented here:
https://docs.oasis-open.org/emergency/cap/v1.2/CAP-v1.2.html
You must have a system which is capable of sending the CAP 1.2 formatted XML in an HTTP request body to use this feature.
Creating a Notification Endpoint
Click the “Create Notification Endpoint” to begin the process:
This will display the Create Endpoint interface:
Fill in the items as follows:
Endpoint Name: Give your endpoint a name that is descriptive and will help you quickly identify it later.
Status: Set the status of your endpoint to “Enabled”. Later, you may wish to make changes to the endpoint and adjusting the status to “disabled” is quicker than deleting and re-creating the endpoint.
Username: You can optionally provide a username for the endpoint. The username and password will need to be supplied in the HTTP header using the “Basic” authentication scheme. See RFC7235 for details: https://tools.ietf.org/html/rfc7617
Password: The basic authentication password.
Auto-Send to Profile: The Sending Profile(s) that the notification should be automatically sent to. We strongly recommend testing with a profile that contains only a few designated testing recipients before enabling with a production sending profile.
Create Notification Endpoint: Click to create the endpoint.
Your endpoint URL will be displayed in the Notification Endpoints listing. Copy the URL and use it in your Requests:
Example: Sending CAP XML to a Notification Endpoint using CURL
Curl is a command line tool that allows sending HTTP requests. We will use Curl to demonstrate sending CAP XML to a notification endpoint.
Step 1: Create Notification Endpoint
Follow the steps at the top of this article to create a notification endpoint. Save the “Endpoint URL”.
Step 2: Download and install Curl
The Curl command line tool can be downloaded from https://curl.haxx.se/download.html
Step 3: Obtain CAP XML and Save to File
For demonstration purposes, we will use the same “Severe Thunderstorm” CAP XML provided on the CAP 1.2 Specifications page. Save the XML below to a file named “CAPAlert.xml”:
<?xml version = "1.0" encoding = "UTF-8"?>
<alert xmlns = "urn:oasis:names:tc:emergency:cap:1.2">
<identifier>KSTO1055887203</identifier>
<sender>KSTO@NWS.NOAA.GOV</sender>
<sent>2003-06-17T14:57:00-07:00</sent>
<status>Actual</status>
<msgType>Alert</msgType>
<scope>Public</scope>
<info>
<category>Met</category>
<event>SEVERE THUNDERSTORM</event>
<responseType>Shelter</responseType>
<urgency>Immediate</urgency>
<severity>Severe</severity>
<certainty>Observed</certainty>
<eventCode>
<valueName>SAME</valueName>
<value>SVR</value>
</eventCode>
<expires>2003-06-17T16:00:00-07:00</expires>
<senderName>NATIONAL WEATHER SERVICE SACRAMENTO CA</senderName>
<headline>SEVERE THUNDERSTORM WARNING</headline>
<description> AT 254 PM PDT...NATIONAL WEATHER SERVICE DOPPLER RADAR INDICATED A SEVERE THUNDERSTORM OVER SOUTH CENTRAL ALPINE COUNTY...OR ABOUT 18 MILES SOUTHEAST OF KIRKWOOD...MOVING SOUTHWEST AT 5 MPH. HAIL...INTENSE RAIN AND STRONG DAMAGING WINDS ARE LIKELY WITH THIS STORM.</description>
<instruction>TAKE COVER IN A SUBSTANTIAL SHELTER UNTIL THE STORM PASSES.</instruction>
<contact>BARUFFALDI/JUSKIE</contact>
<area>
<areaDesc>EXTREME NORTH CENTRAL TUOLUMNE COUNTY IN CALIFORNIA, EXTREME NORTHEASTERN CALAVERAS COUNTY IN CALIFORNIA, SOUTHWESTERN ALPINE COUNTY IN CALIFORNIA</areaDesc>
<polygon>38.47,-120.14 38.34,-119.95 38.52,-119.74 38.62,-119.89 38.47,-120.14</polygon>
<geocode>
<valueName>SAME</valueName>
<value>006109</value>
</geocode>
<geocode>
<valueName>SAME</valueName>
<value>006009</value>
</geocode>
<geocode>
<valueName>SAME</valueName>
<value>006003</value>
</geocode>
</area>
</info>
</alert>
Step 4: Run the Curl Command
Next, we will run the Curl command to send the XML to the Notification Endpoint. Adjust the command below with your XML file path, username and password (if defined on the Endpoint), and Endpoint URL:
curl -X POST -d @CAPAlert.xml -u [Username]:[Password] [Endpoint URL]
If successful, Curl should show the following:
Message Sent
Step 5: Check Inbound Notification History
You can verify whether the message was sent successfully by accessing the “Notification Endpoint History” to view a log of all inbound notifications:
Step 6: View Inbound Notification Details
Details of each inbound notification are logged and available to view. From the Notification Endpoint History page, locate the appropriate notification and choose the “Details” button:
You will then see the details of the inbound notification, including any error message. This information is helpful when performing initial setup:
Step 7: Tracking
Inbound notifications are sent just like regular notifications, and they generate the same tracking data. You can quickly jump to the tracking data by clicking the “Tracking” button on the “Notification Endpoint History” page:
Refer to the Tracking documentation for detailed information about accessing tracking reports.