Comment on page
Requesting Active Hazards
To request the list of current active hazards please use the route defined here:
get
https://api.disasteraware.com/
hazards/active
Get active hazards
cURL
Java
Node.js
PHP
Python
curl --location --request GET \
'https://api.disasteraware.com/hazards/active' \
--header 'Authorization: Bearer your_accessToken'
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Scanner;
class Main {
public static void main(String[] args) throws IOException {
URL url = new URL("https://api.disasteraware.com/hazards/active");
HttpURLConnection httpConn = (HttpURLConnection) url.openConnection();
httpConn.setRequestMethod("GET");
httpConn.setRequestProperty("Authorization", "Bearer your_accessToken");
InputStream responseStream = httpConn.getResponseCode() / 100 == 2
? httpConn.getInputStream()
: httpConn.getErrorStream();
Scanner s = new Scanner(responseStream).useDelimiter("\\A");
String response = s.hasNext() ? s.next() : "";
System.out.println(response);
}
}
var fetch = require('node-fetch');
fetch('https://api.disasteraware.com/hazards/active', {
headers: {
'Authorization': 'Bearer your_accessToken'
}
});
<?php
include('vendor/rmccue/requests/library/Requests.php');
Requests::register_autoloader();
$headers = array(
'Authorization' => 'Bearer your_accessToken'
);
$response = Requests::get('https://api.disasteraware.com/hazards/active', $headers);
import requests
headers = {
'Authorization': 'Bearer your_accessToken',
}
response = requests.get('https://api.disasteraware.com/hazards/active', headers=headers)
The response will include an array of objects that reflect the currently active hazards in the system. Each element in the array will include the following properties:
Properties | Definitions |
app_ID | This is probably safe to ignore. This represents the application that created the hazard. Hazards are federated and can be synchronized by different versions of DisasterAWARE. In DAE most hazards will have an app_ID of 0. This means that the hazard was created by the “data core” or central processing for hazards. Hazards created by users or automated processes specific to an instance of DisasterAWARE will carry the application id of that system. Systems can set up rules for synchronization with other systems e.g. to share or not share hazards created within that environment. |
app_IDs | Deprecated. |
autoexpire | Indicates whether or not the hazard will automatically expire. There are different rules for how long a hazard shall persist. |
category_ID | The category of this hazard e.g. EVENT, RESPONSE. |
charter_Uri | Deprecated. Safe to ignore. |
create_date | The time the hazard object was created. The value is a Unix timestamp. |
description | A human-readable description of the hazard. |
end_Date | The time the hazard will expire if it is set to auto-expire. The value is a Unix timestamp. |
glide_Uri | Deprecated. Safe to ignore. |
hazard_ID | The primary key for this hazard. |
hazard_Name | The human-readable name for this hazard. |
in_Dashboard | Safe to ignore. |
last_Update | The time that the hazard was last updated. The value is a Unix timestamp. |
latitude | The hazard’s latitude in WGS84 projection. |
longitude | The hazard’s longitude in WGS84 projection. |
master_Incident_ID | Safe to ignore. |
message_ID | Safe to ignore. |
org_ID | The organization that owns this hazard. Safe to ignore unless you are creating or updating products. |
product_total | The number of products associated with this hazard. |
severity_ID | The severity of this hazard e.g. WATCH, WARNING |
snc_url | An optional URL that links to a web page that contains a human-readable summary of the hazard. |
start_Date | The time this hazard was started. The value is a Unix timestamp. |
status | Indicates the current status of this hazard. There are two possible values: A (Active) or E (Expired) |
type_ID | The type for this hazard e.g. AVALANCHE, CYCLONE. |
update_Date | The time the hazard object was last modified. |
update_User | If this hazard was modified by a user, the value will be the user’s username. |
uuid | The unique identifier for this hazard across all DisasterAWARE systems. |