Comment on page
Requesting a Hazard’s Products
To request the list of products associated to a hazard:
get
https://api.disasteraware.com/
hazards/{hazard-id}/products
Get a list of products
Below is an example request with path parameters hazard-id=134583
cURL
Java
Node.js
PHP
Python
curl --location --request GET \
'https://api.disasteraware.com/hazards/134583/products' \
--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/134583/products");
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/134583/products', {
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/134583/products', $headers);
import requests
headers = {
'Authorization': 'Bearer your_accessToken',
}
response = requests.get('https://api.disasteraware.com/hazards/134583/products', headers=headers)
The response will include an array of product objects. Each element in the array will include the following properties:
Properties | Definitions |
app_IDs | The identifier for the application that created this product |
comment_Text | A human readable comment attached to the document. |
create_Date | The time this product was created. The value is a unix timestamp. |
data | If this product is of type “text”, this value will be the product’s message. If the product is of type “url”, this value will be the hyperlink associated with the product. |
filename | If this product is of type “file”, this value will be the filename of the file that was assigned to the product. |
geo_Locations | An optional location on the earth that has been assigned to the product. The value is in WKT. |
hazard_ID | The ID of the hazard that owns this product. |
is_Hidden | This boolean flag indicates whether or not this products will be hidden from the user interface. |
org_ID | Users of a DisasterAWARE system must belong to an organization. The products automatically assigned to the organization of the user who created the product. |
org_IDs | An optional comma separated list of organizations who owns this product. Products can be assigned to one or more organizations. Products that are assigned to an organization(s) are only visible to members of that organization. |
organization_acronym | Deprecated. Safe to ignore. |
parent_ID | The ID of the folder product in which this product is contained. A value of zero indicates that this product is on the root of the hierarchy. |
product_ID | the primary key of this product. |
product_Type | this product’s type. For more information, please see the section on product’s types. |
product_url | If this product is a file, this value will contain the location to use to request the source file. |
security_Flag | this product indicates whether or not this product has been assigned to one or more organizations. A value of “R” indicates it has been restricted to one or more organizations. Otherwise, the value will be “A”. |
suffix | If this product is a file, this value represents the file extension of the source file e.g. ‘txt’, ‘pdf’, ‘doc’ etc… |
timeline_Date | If this product is displayed in a timeline, this value is used to display the time the author has decided to associate to this product. The value is a unix timestamp. |
title | A string title for this product. |
update_Date | The time this product was last modified. The value is a unix timestamp. |
update_User | The username of the user who last modified this product. |
user_ID | The username of the user who created this product. |
uuid | The unique identifier for this product across all DisasterAWARE systems. |
Last modified 2yr ago