For the complete documentation index, see llms.txt. This page is also available as Markdown.

Authorizing Requests

In most cases, when sending requests to the DaaS services, the request includes a header that contains an authorization code. The authorization code is acquired by sending a request to DAE’s DaaS token service.

Authorization API

URL

HTTP Verb

Functionality

/authorize

POST

Login with posting credentials to get access and refresh JSON Web Tokens

Get accessToken and refreshToken

POST https://api.disasteraware.com/authorize

Login with posting credentials to get access and refresh JSON Web Tokens

Request Body

Name
Type
Description

User credential

object

User credential.

{
    "accessToken":"access.token.will.be.here",
    "refreshToken":"refresh.token.will.be.here"
}
Authentication failed.
curl --location --request POST \
  'https://api.disasteraware.com/authorize' \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "username":"your_username", 
    "password":"your_password"
  }'
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStreamWriter;
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/authorize");
		HttpURLConnection httpConn = (HttpURLConnection) url.openConnection();
		httpConn.setRequestMethod("POST");

		httpConn.setRequestProperty("Content-Type", "application/json");

		httpConn.setDoOutput(true);
		OutputStreamWriter writer = new OutputStreamWriter(httpConn.getOutputStream());
		writer.write("{ \"username\":\"your_username\", \"password\":\"your_password\" }");
		writer.flush();
		writer.close();
		httpConn.getOutputStream().close();

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

Last updated

Was this helpful?