# Requesting Hazard Severities

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

## Get hazard severities

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

#### Headers

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

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

```
[
  {
    "severity_id": "TERMINATION",
    "severity_name": "Termination",
    "severity_icon": "termination.png"
  },
  {
    "severity_id": "INFORMATION",
    "severity_name": "Information",
    "severity_icon": "information.png"
  },
  {
    "severity_id": "ADVISORY",
    "severity_name": "Advisory",
    "severity_icon": "advisory.png"
  },
  {
    "severity_id": "WATCH",
    "severity_name": "Watch",
    "severity_icon": "watch.png"
  },
  {
    "severity_id": "WARNING",
    "severity_name": "Warning",
    "severity_icon": "warning.png"
  }
]
```

{% endtab %}

{% tab title="403 " %}

```
Invalid Token
```

{% endtab %}
{% endtabs %}

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

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

```
curl --location --request GET \
  'https://api.disasteraware.com/hazards/severities' \
  --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/severities");
		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/severities', {
    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/severities', $headers);

```

{% endtab %}

{% tab title="Python" %}

```python
import requests

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

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

```

{% endtab %}
{% endtabs %}

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

| Properties         | Definitions                                                                                                      |
| ------------------ | ---------------------------------------------------------------------------------------------------------------- |
| **severity\_id**   | This is like the primary key for the hazard severity. This is the value that will be found on the hazard object. |
| **severity\_name** | A human readable value for the severity e.g. Warning.                                                            |
| **severity\_icon** | This is an icon whose value was used in the deprecated version of DAE.                                           |

{% hint style="info" %}
In every DAE system the following colors (in RGB format) are associated with each hazard severity:
{% endhint %}

| Hazard Severities | Colors (in RGB format) |
| ----------------- | ---------------------- |
| **TERMINATION**   | 102, 102, 102          |
| **INFORMATION**   | 49, 153, 240           |
| **ADVISORY**      | 0, 255, 0              |
| **WATCH**         | 255, 255, 0            |
| **WARNING**       | 255, 0, 0              |
