Comment on page
Requesting a Product
get
https://api.disasteraware.com/
products/{product-id}
Get a product details
Below is an example request with path parameters product-id=1153909
cURL
Java
Node.js
PHP
Python
curl --location --request GET \
'https://api.disasteraware.com/products/1153909' \
--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/products/1153909");
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/products/1153909', {
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/products/1153909', $headers);
import requests
headers = {
'Authorization': 'Bearer your_accessToken',
}
response = requests.get('https://api.disasteraware.com/products/1153909', headers=headers)
Last modified 2yr ago