The DisasterConnect API provides programmatic access to disaster response coordination features. This RESTful API allows you to manage incidents, resources, and communications programmatically.
All API requests require authentication using JWT (JSON Web Tokens).
curl -H "Authorization: Bearer YOUR_JWT_TOKEN" https://api.disasterconnect.local/v1/incidentsPOST /api/v1/auth/tokenRequest body:
{
"username": "your_username",
"password": "your_password"
}Response:
{
"access_token": "eyJhbGciOiJIUzI1NiIs...",
"token_type": "bearer",
"expires_in": 3600
}GET /api/v1/incidentsQuery parameters:
status(string): Filter by incident statusseverity(string): Filter by severity levelpage(integer): Page number for paginationlimit(integer): Results per page
Response:
{
"incidents": [
{
"id": "inc_123",
"title": "Flood in Downtown",
"status": "active",
"severity": "high",
"location": {
"lat": 40.7128,
"lng": -74.0060
},
"created_at": "2023-11-14T12:00:00Z"
}
],
"total": 100,
"page": 1,
"limit": 10
}POST /api/v1/incidentsRequest body:
{
"title": "Flood in Downtown",
"description": "Severe flooding reported",
"severity": "high",
"location": {
"lat": 40.7128,
"lng": -74.0060
}
}GET /api/v1/resourcesQuery parameters:
type(string): Filter by resource typestatus(string): Filter by statuspage(integer): Page numberlimit(integer): Results per page
POST /api/v1/incidents/{incident_id}/resourcesRequest body:
{
"resource_id": "res_456",
"assignment_duration": "2h",
"priority": "high"
}POST /api/v1/messagesRequest body:
{
"recipient_id": "user_789",
"content": "Emergency response needed",
"priority": "high"
}GET /api/v1/messagesQuery parameters:
since(timestamp): Get messages after timestamplimit(integer): Number of messages to return
POST /api/v1/webhooksRequest body:
{
"url": "https://your-server.com/webhook",
"events": ["incident.created", "resource.assigned"]
}incident.createdincident.updatedresource.assignedresource.updatedmessage.sent
- 1000 requests per hour per API key
- Rate limit headers included in responses:
X-RateLimit-LimitX-RateLimit-RemainingX-RateLimit-Reset
{
"error": {
"code": "unauthorized",
"message": "Invalid or expired token",
"details": {
"token_expired_at": "2023-11-14T13:00:00Z"
}
}
}400: Bad Request401: Unauthorized403: Forbidden404: Not Found429: Too Many Requests500: Internal Server Error
from disasterconnect import DisasterConnectClient
client = DisasterConnectClient('your_api_key')
# Create an incident
incident = client.incidents.create(
title="Flood in Downtown",
description="Severe flooding reported",
severity="high",
location={"lat": 40.7128, "lng": -74.0060}
)
# Assign a resource
client.incidents.assign_resource(
incident_id=incident.id,
resource_id="res_456",
assignment_duration="2h"
)const DisasterConnect = require('disasterconnect');
const client = new DisasterConnect('your_api_key');
// List active incidents
client.incidents.list({ status: 'active' })
.then(incidents => {
console.log(incidents);
})
.catch(error => {
console.error(error);
});For API support:
- Email: saqlainrazee@gmail.com
- GitHub Issues: Report a bug
- API Status: status.disasterconnect.local