UFAMS exposes an ASP.NET Core Minimal API used by the Next.js frontend and ArcGIS integration.
The API provides functionality for:
- Tree asset management
- Tree searching and spatial queries
- GeoJSON export
- Species lookup
- Park inventory
- Tree inspections
- Maintenance work orders
- ArcGIS authentication
- ArcGIS Feature Service access
- ArcGIS synchronization
- Synchronization audit history
Unless otherwise noted, successful responses return JSON.
https://localhost:<port>
The exact development port is configured by the ASP.NET Core launch configuration.
The production API URL is environment-specific and should not be hard-coded into this documentation.
POST /treesRegisters a new tree in UFAMS.
RegisterTreeCommand
201 Created
The response contains the newly created tree.
GET /treesReturns trees matching optional filter criteria.
| Parameter | Type | Required | Description |
|---|---|---|---|
parkId |
GUID | No | Filter by park |
speciesId |
GUID | No | Filter by species |
healthStatus |
enum | No | Filter by tree health |
GET /trees?healthStatus=Poor200 OK
GET /trees/{id}Returns a specific tree.
| Parameter | Type | Description |
|---|---|---|
id |
GUID | Tree ID |
200 OK
PUT /trees/{id}/measurementsUpdates measurements for a tree.
| Parameter | Type | Description |
|---|---|---|
id |
GUID | Tree ID |
UpdateTreeMeasurementsCommand
200 OK
PUT /trees/{id}/locationUpdates the geographic location of a tree.
| Parameter | Type | Description |
|---|---|---|
id |
GUID | Tree ID |
RelocateTreeCommand
200 OK
PUT /trees/{id}/healthUpdates the health status of a tree.
| Parameter | Type | Description |
|---|---|---|
id |
GUID | Tree ID |
UpdateTreeHealthCommand
200 OK
GET /trees/searchSearches trees using multiple optional criteria.
| Parameter | Type | Required | Description |
|---|---|---|---|
parkId |
GUID | No | Filter by park |
speciesId |
GUID | No | Filter by species |
healthStatus |
enum | No | Filter by health |
minLatitude |
number | No | Minimum latitude |
maxLatitude |
number | No | Maximum latitude |
minLongitude |
number | No | Minimum longitude |
maxLongitude |
number | No | Maximum longitude |
GET /trees/search?healthStatus=Poor&parkId=<guid>200 OK
GET /trees/geojsonExports trees as GeoJSON for GIS and mapping workflows.
| Parameter | Type | Required |
|---|---|---|
parkId |
GUID | No |
speciesId |
GUID | No |
healthStatus |
enum | No |
minLatitude |
number | No |
maxLatitude |
number | No |
minLongitude |
number | No |
maxLongitude |
number | No |
200 OK
Returns a GeoJSON feature collection.
GET /trees/nearbyReturns trees within a specified radius of a geographic coordinate.
| Parameter | Type | Required | Description |
|---|---|---|---|
latitude |
number | Yes | Latitude |
longitude |
number | Yes | Longitude |
radiusMeters |
number | Yes | Search radius in metres |
GET /trees/nearby?latitude=49.2827&longitude=-123.1207&radiusMeters=500200 OK
Invalid geographic/search parameters may return:
400 Bad Request
GET /speciesReturns all tree species managed by UFAMS.
200 OK
GET /species/searchSearches species using a search term.
| Parameter | Type | Required |
|---|---|---|
query |
string | Yes |
GET /species/search?query=cedar200 OK
GET /parksReturns all parks managed by UFAMS.
200 OK
GET /parks/{parkId}/inventoryReturns inventory information for a park.
The inventory includes tree counts, health statistics, and species breakdown.
| Parameter | Type | Description |
|---|---|---|
parkId |
GUID | Park ID |
200 OK
POST /trees/{treeId}/inspectionsCreates an inspection for a specific tree.
| Parameter | Type |
|---|---|
treeId |
GUID |
CreateInspectionCommand
201 Created
GET /trees/{treeId}/inspectionsReturns all inspections associated with a tree.
200 OK
GET /inspectionsReturns all inspection records.
200 OK
GET /inspections/{id}Returns a specific inspection.
| Parameter | Type |
|---|---|
id |
GUID |
200 OK
PUT /inspections/{id}/notesUpdates notes associated with an inspection.
UpdateInspectionNotesCommand
200 OK
PUT /inspections/{id}/recommendationUpdates the recommendation associated with an inspection.
UpdateInspectionRecommendationCommand
200 OK
PUT /inspections/{id}/follow-upSchedules a follow-up action for an inspection.
ScheduleFollowUpCommand
200 OK
POST /trees/{treeId}/work-ordersCreates a work order associated with a tree.
CreateWorkOrderCommand
201 Created
GET /trees/{treeId}/work-ordersReturns all work orders associated with a tree.
200 OK
GET /work-ordersGET /work-orders
Returns all work orders, including related tree, species, park, and employee information.
Response
200 OK
GET /work-orders/{id}
Returns a specific work order.
Response
200 OK
PUT /work-orders/{id}/assign
Assigns a work order to an employee/user.
Request Body
AssignWorkOrderCommand
Response
200 OK
PUT /work-orders/{id}/start
Starts a work order.
Response
200 OK
PUT /work-orders/{id}/complete
Completes a work order.
Response
200 OK
PUT /work-orders/{id}/cancel
Cancels a work order.
Response
200 OK
UFAMS integrates with ArcGIS Feature Services for GIS asset management and synchronization.
GET /arcgis/token-test
Requests an ArcGIS access token and returns a success result without exposing the token itself.
Response
Example:
{
"success": true,
"tokenLength": 123
}Deployment note: The current callback redirects to the development frontend URL. This must be made environment-specific before production deployment.
ArcGIS Authentication Status GET /api/arcgis/auth/status
Returns whether UFAMS currently has an authenticated ArcGIS session.
Example Response
{
"authenticated": true
}ArcGIS Logout POST /api/arcgis/auth/logout
Clears the in-memory ArcGIS token and persisted token.
Example Response
{
"authenticated": false
}GET /arcgis/sync/preview
Generates a synchronization result without applying the changes to the UFAMS database.
200 OK
The response contains the synchronization result.
POST /arcgis/sync/apply
Applies ArcGIS synchronization changes to UFAMS.
200 OK
POST /arcgis/sync/apply/{assetTag}
Applies synchronization for a single tree asset.
| Parameter | Type | Required |
|---|---|---|
assetTag |
string |
Yes |
An empty asset tag returns:
400 Bad Request
GET /arcgis/sync/audits
Returns recent ArcGIS synchronization audit history.
The current implementation requests the 50 most recent audits.
Each audit includes information such as:
- Audit ID
- Start time
- Completion time
- Status
- Created count
- Updated count
- Failed count
- Ignored count
- Synchronization entries
Each synchronization entry includes:
- Entry ID
- Asset tag
- Action
- Reason
- Creation time
200 OK
UFAMS uses standard HTTP response status codes.
| Status | Meaning |
|---|---|
200 OK |
Request completed successfully |
201 Created |
Resource was successfully created |
400 Bad Request |
Request parameters or input are invalid |
404 Not Found |
Requested resource does not exist |
409 Conflict |
Request conflicts with the current state |
500 Internal Server Error |
Unexpected server-side failure |
Exception handling is centralized through the UFAMS API exception-handling middleware.
The API layer is intentionally thin.
Endpoint classes are responsible primarily for:
- Receiving HTTP requests.
- Binding route/query/body parameters.
- Constructing commands or queries.
- Invoking application handlers/services.
- Returning HTTP responses.
Business logic is implemented primarily in the Application and Domain layers.
HTTP Request
│
▼
TreeEndpoints
│
▼
GetTreesQuery
│
▼
GetTreesHandler
│
▼
ITreeRepository
│
▼
EF Core / SQL Server
ArcGIS synchronization follows a similar separation:
HTTP Request
│
▼
ArcGisSyncEndpoints
│
▼
SpatialDataSyncService
│
├── ArcGIS Feature Service
│
└── UFAMS repositories
│
▼
SQL Server
Swagger/OpenAPI is enabled in the ASP.NET Core development environment.
When running UFAMS in development, Swagger UI is available through the configured development API URL:
/swagger
Swagger is not enabled by the current production pipeline configuration.