API Endpoints - Complete Reference
Component: DWD API (ASP.NET Core) Purpose: Complete reference for all API endpoints Date: October 2025 Status: Living Document
Table of Contents
1. Configuration System
Base URL: /api/Configuration/
| Method | Endpoint | Description |
|---|---|---|
| GET | /all | Get complete configuration ⭐ Recommended for frontend |
| GET | /for-entity/{entityType} | Get configuration for specific entity type |
| GET | /for-metric/{metricId} | Get configuration for specific metric |
| GET | /summary | Get configuration summary and counts |
Example: Get All Configuration
GET /api/Configuration/all
Response:
{
"entityTypes": [...],
"metrics": [...],
"visualizationConfigs": [...],
"constants": {...},
"modelUnits": [...]
}
2. Entity Types
Base URL: /api/EntityTypes/
| Method | Endpoint | Description |
|---|---|---|
| GET | / | Get all entity type configurations |
| GET | /{id} | Get entity type by ID |
| GET | /category/{category} | Get entity types by category (Node/Link) |
| GET | /ids | Get all entity type IDs |
Example: Get Entity Type
GET /api/EntityTypes/Tank
Response:
{
"id": "Tank",
"name": "Tank",
"category": "Node",
"description": "Storage tank with variable volume",
"baseProperties": ["Id", "Index", "XCoord", "YCoord"],
"specificProperties": ["InitVolume", "InitQual", "MinLevel", "MaxLevel"],
"availableMetrics": {
"Hydraulic": ["Head", "Demand", "Pressure"],
"Quality": ["CHLORINE", "TR1", "AGE"]
}
}
3. Metrics
Base URL: /api/Metrics/
| Method | Endpoint | Description |
|---|---|---|
| GET | / | Get all metric configurations |
| GET | /{id} | Get metric by ID |
| GET | /category/{category} | Get metrics by category (Hydraulic/Quality) |
| GET | /for-entity/{entityType} | Get metrics for entity type |
| GET | /ids | Get all metric IDs |
| GET | /aggregators | Get all available aggregators |
Example: Get Metrics for Entity
GET /api/Metrics/for-entity/Tank
Response:
[
{
"id": "Head",
"name": "Head",
"category": "Hydraulic",
"aggregators": ["avg", "min", "max"],
"floatPrecision": 2
},
...
]
4. Visualization
Base URL: /api/VisualizationConfig/
| Method | Endpoint | Description |
|---|---|---|
| GET | / | Get all visualization configurations |
| GET | /{id} | Get visualization config by ID |
| GET | /for-metric/{metricId} | Get configs for metric |
| GET | /heatmap-color-stops/{metricId} | Get heatmap color stops |
| GET | /heatmap-renderer/{metricId} | Get heatmap renderer settings |
Example: Get Heatmap Config
GET /api/VisualizationConfig/heatmap-color-stops/Flow
Response:
{
"metricId": "Flow",
"colorStops": [0, 0.001, 0.3, 0.4, 1],
"colors": ["#blue", "#cyan", "#yellow", "#orange", "#red"]
}
5. Network Elements
Nodes
Junctions: /api/junctions/
Tanks: /api/tanks/
Reservoirs: /api/reservoirs/
| Method | Endpoint | Description |
|---|---|---|
| GET | / | Get all nodes |
| GET | /{id} | Get node by ID |
| GET | /scenario/{scenarioId} | Get nodes for scenario |
| PUT | /{id} | Update node properties |
Links
Pipes: /api/pipes/
Pumps: /api/pumps/
Valves: /api/valves/
| Method | Endpoint | Description |
|---|---|---|
| GET | / | Get all links |
| GET | /{id} | Get link by ID |
| GET | /scenario/{scenarioId} | Get links for scenario |
| PUT | /{id} | Update link properties |
6. Scenarios
Base URL: /api/Scenario/ (Note: Singular)
| Method | Endpoint | Description |
|---|---|---|
| GET | / | Get all scenarios |
| GET | /{id} | Get scenario by ID |
| POST | / | Create new scenario |
| PUT | /{id} | Update scenario |
| DELETE | /{id} | Delete scenario |
| GET | /download/{id} | Download scenario INP file |
| POST | /{id}/run | Run scenario simulation |
Authentication
Note: Authentication implementation varies by deployment. Check your specific API configuration for:
- JWT token requirements
- CORS policy
- Authorization headers
Error Responses
All endpoints follow standard HTTP status codes:
| Code | Meaning | Example |
|---|---|---|
| 200 | OK | Successful GET/PUT |
| 201 | Created | Successful POST |
| 204 | No Content | Successful DELETE |
| 400 | Bad Request | Invalid input data |
| 404 | Not Found | Resource doesn't exist |
| 500 | Server Error | Internal error |
Related Documentation:
- Configuration API: See
ConfigurationAPI.md - Property Embedding: See
API_Property_Embedding_Strategy.md - API Testing: See
API-Testing-README.md
Status: ✅ Living Reference Last Updated: October 2025