Skip to main content

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
  2. Entity Types
  3. Metrics
  4. Visualization
  5. Network Elements
  6. Scenarios

1. Configuration System

Base URL: /api/Configuration/

MethodEndpointDescription
GET/allGet 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/summaryGet 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/

MethodEndpointDescription
GET/Get all entity type configurations
GET/{id}Get entity type by ID
GET/category/{category}Get entity types by category (Node/Link)
GET/idsGet 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/

MethodEndpointDescription
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/idsGet all metric IDs
GET/aggregatorsGet 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/

MethodEndpointDescription
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/

MethodEndpointDescription
GET/Get all nodes
GET/{id}Get node by ID
GET/scenario/{scenarioId}Get nodes for scenario
PUT/{id}Update node properties

Pipes: /api/pipes/ Pumps: /api/pumps/ Valves: /api/valves/

MethodEndpointDescription
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)

MethodEndpointDescription
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}/runRun 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:

CodeMeaningExample
200OKSuccessful GET/PUT
201CreatedSuccessful POST
204No ContentSuccessful DELETE
400Bad RequestInvalid input data
404Not FoundResource doesn't exist
500Server ErrorInternal 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