# Requesting Hazard Categories

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

## Get hazard categories

<mark style="color:blue;">`GET`</mark> `https://api.disasteraware.com/hazards/categories`

#### Headers

| Name          | Type   | Description                  |
| ------------- | ------ | ---------------------------- |
| Authorization | string | Authorize to access the API. |

{% tabs %}
{% tab title="200 " %}

```
[
    {
        "category_id": "EVENT",
        "category_name": "Event"
    },
    {
        "category_id": "EXERCISE",
        "category_name": "Exercise"
    },
    {
        "category_id": "OTHER",
        "category_name": "Other"
    },
    {
        "category_id": "RESPONSE",
        "category_name": "Response"
    }
]
```

{% endtab %}

{% tab title="403 " %}

```
Invalid Token
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
See [Authorizing Requests](/authentication/authorizing-requests.md#get-accesstoken-and-refreshtoken) page to get your accessToken.
{% endhint %}

{% tabs %}
{% tab title="cURL" %}

```
curl --location --request GET \
  'https://api.disasteraware.com/hazards/categories' \
  --header 'Authorization: Bearer your_accessToken'
```

{% endtab %}

{% tab title="Java" %}

```java
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);
	}
}

```

{% endtab %}

{% tab title="Node.js" %}

```javascript
var fetch = require('node-fetch');

fetch('https://api.disasteraware.com/hazards/categories', {
    headers: {
        'Authorization': 'Bearer your_accessToken'
    }
});

```

{% endtab %}

{% tab title="PHP" %}

```php
<?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);

```

{% endtab %}

{% tab title="Python" %}

```python
import requests

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

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

```

{% endtab %}
{% endtabs %}

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.                                                              |

{% hint style="info" %}
The following shapes are associated with each hazard category:
{% endhint %}

| Categories   | Shapes   |
| ------------ | -------- |
| **EVENT**    | Circle   |
| **RESPONSE** | Star     |
| **EXERCISE** | Triangle |
| **OTHER**    | Hexagon  |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://api-docs.disasteraware.com/hazards/requesting-hazard-categories.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
