DAE API Documentation
  • Introduction
  • Authentication
    • Authorizing Requests
  • Hazards
    • What are Global Active Hazards?
    • Requesting Hazard Types
    • Requesting Hazard Severities
    • Requesting Hazard Categories
    • Requesting Active Hazards
      • Requesting Active Hazards of a Specific Category
      • Requesting Active Hazards of a Specific Severity
    • Hazard’s Smart Alert Geography
  • Products
    • What are Products?
    • Requesting Product Types
    • Requesting a Hazard’s Products
    • Requesting a Product
Powered by GitBook
On this page

Was this helpful?

  1. Hazards

Requesting Hazard Categories

To request the list of hazard categories configured in the system please use the route defined here:

Get hazard categories

GET https://api.disasteraware.com/hazards/categories

Headers

Name
Type
Description

Authorization

string

Authorize to access the API.

[
    {
        "category_id": "EVENT",
        "category_name": "Event"
    },
    {
        "category_id": "EXERCISE",
        "category_name": "Exercise"
    },
    {
        "category_id": "OTHER",
        "category_name": "Other"
    },
    {
        "category_id": "RESPONSE",
        "category_name": "Response"
    }
]
Invalid Token
curl --location --request GET \
  'https://api.disasteraware.com/hazards/categories' \
  --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/categories");
		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/categories', {
    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/categories', $headers);
import requests

headers = {
    'Authorization': 'Bearer your_accessToken',
}

response = requests.get('https://api.disasteraware.com/hazards/categories', headers=headers)

This request will return an array that contains all of the hazard severities. Each element in the array will have two properties:

Properties

Definitions

category_id

This is like the primary key for the hazard category. This is the value that will be found on the hazard object.

category_name

A human readable value for the category e.g. Event.

The following shapes are associated with each hazard category:

Categories

Shapes

EVENT

Circle

RESPONSE

Star

EXERCISE

Triangle

OTHER

Hexagon

PreviousRequesting Hazard SeveritiesNextRequesting Active Hazards

Last updated 4 years ago

Was this helpful?

See page to get your accessToken.

Authorizing Requests