FiixCmms.Client
1.0.1-rc4
dotnet add package FiixCmms.Client --version 1.0.1-rc4
NuGet\Install-Package FiixCmms.Client -Version 1.0.1-rc4
<PackageReference Include="FiixCmms.Client" Version="1.0.1-rc4" />
<PackageVersion Include="FiixCmms.Client" Version="1.0.1-rc4" />
<PackageReference Include="FiixCmms.Client" />
paket add FiixCmms.Client --version 1.0.1-rc4
#r "nuget: FiixCmms.Client, 1.0.1-rc4"
#:package FiixCmms.Client@1.0.1-rc4
#addin nuget:?package=FiixCmms.Client&version=1.0.1-rc4&prerelease
#tool nuget:?package=FiixCmms.Client&version=1.0.1-rc4&prerelease
<div align="center"> <img src="https://raw.githubusercontent.com/Screaminlean/FiixCmms.Client.Net/main/img/fiix_logo.png" alt="Fiix CMMS" width="200"/> </div>
Fiix CMMS .NET Client
A .NET 8 / .NET 10 client library for interacting with the Fiix CMMS API. Provides a strongly-typed, async interface for CRUD, RPC, and Batch operations.
Verified against the live Fiix CMMS sandbox (API version 2.48.1).
Disclaimer: This is an independent, community-built library. I am not affiliated with, employed by, or sponsored by Fiix Software or Rockwell Automation. I receive no compensation of any kind for this project. I simply use Fiix at my workplace and built this library to make .NET integration easier for others in the same position. Fiix and Rockwell Automation are trademarks of their respective owners.
Features
- ✅ 107 DTOs — Complete model coverage for Fiix CMMS entities
- ✅ CRUD operations —
FindById,Find,Add,Change,Remove - ✅ RPC operations — All 18 documented RPC methods
- ✅ Batch operations — Multi-operation execution in a single HTTP request
- ✅ Async/await — All I/O operations are async; no blocking wrappers
- ✅ HMAC SHA256 authentication — Request signing built in
- ✅ Throttle handling — Automatic retry on 429 responses
- ✅ Cancellation — All async methods accept
CancellationToken - ✅ Microsoft DI support —
AddFiixClient()extension forIServiceCollection; usesIHttpClientFactoryto prevent socket exhaustion - ✅ Nullable reference types — Full .NET nullable support
- ✅ Multi-target — Targets .NET 8 (LTS) and .NET 10
Design Philosophy
Async-Only API
All network methods are async — there are no synchronous wrappers. This matches HttpClient, the Azure SDK, and EF Core, and avoids deadlocks in UI and ASP.NET contexts.
// ✅ Correct
public async Task<List<Asset>> GetAssetsAsync()
{
var request = _client.PrepareFind<Asset>();
var response = await _client.FindAsync(request);
return response.Objects ?? [];
}
// ❌ Avoid — .Result can deadlock in UI / ASP.NET contexts
var response = _client.FindAsync(request).Result;
For legacy synchronous contexts only:
var response = client.FindAsync(request).GetAwaiter().GetResult();
See: Don't Block on Async Code
Installation
NuGet (recommended)
dotnet add package FiixCmms.Client
Or search for FiixCmms.Client in the Visual Studio NuGet Package Manager.
From source
Clone the repo and add a project reference:
dotnet add reference path/to/FiixCmms.Client/FiixCmms.Client.csproj
Quick Start
using FiixCmms.Client;
using FiixCmms.Client.Models;
var credentials = new BasicCredentials(
appKey: "your-app-key",
accessKey: "your-access-key",
secretKey: "your-secret-key"
);
var client = new FiixCmmsClient(
credentials,
baseUri: "https://yourinstance.fiixsandbox.com/api/"
);
// Find a work order by ID
var request = client.PrepareFindById<WorkOrder>();
request.Id = 12345;
request.Fields = "id, strCode, strDescription";
var response = await client.FindByIdAsync(request);
if (response.Error == null)
{
Console.WriteLine($"Work Order: {response.Object?.StrCode}");
Console.WriteLine($"Description: {response.Object?.StrDescription}");
}
else
{
Console.WriteLine($"Error [{response.Error.Code}]: {response.Error.Message}");
}
Usage Examples
Find Multiple Records
using FiixCmms.Client.Api.Crud;
// Find open work orders
var findRequest = client.PrepareFind<WorkOrder>();
findRequest.Fields = "id, strCode, strDescription, intWorkOrderStatusID";
findRequest.Filters = new List<FindFilter>
{
new FindFilter
{
Ql = "intWorkOrderStatusID = ?",
Parameters = new List<object> { 1 }
}
};
findRequest.OrderBy = "strCode";
findRequest.Limit = 10;
var response = await client.FindAsync(findRequest);
if (response.Error == null)
{
foreach (var workOrder in response.Objects ?? [])
{
Console.WriteLine($"{workOrder.Id}: {workOrder.StrCode}");
}
}
Create a New Record
// Add a new asset
var addRequest = client.PrepareAdd<Asset>();
addRequest.Object = new Asset
{
StrName = "New Equipment",
StrCode = "EQ-001",
IntSiteID = 1
};
addRequest.Fields = "id, strName, strCode";
var response = await client.AddAsync(addRequest);
if (response.Error == null)
{
Console.WriteLine($"Created asset with ID: {response.Object?.Id}");
}
Update Records
// Update a work order
var changeRequest = client.PrepareChange<WorkOrder>();
changeRequest.Object = new WorkOrder
{
Id = 12345,
StrDescription = "Updated description",
IntPriorityID = 2
};
changeRequest.ChangeFields = "strDescription, intPriorityID"; // only these fields are written
changeRequest.Fields = "id, strCode, strDescription"; // fields returned in response
var response = await client.ChangeAsync(changeRequest);
// response.Object -> WorkOrder? with updated values
Delete Records
// Remove a record by ID
var removeRequest = client.PrepareRemove<Asset>();
removeRequest.Id = 12345;
var response = await client.RemoveAsync(removeRequest);
if (response.Error == null)
{
Console.WriteLine($"Removed {response.Count} record(s)");
}
RPC (Remote Procedure Call) Operations
// Ping the server
var rpcRequest = client.PrepareRpc();
rpcRequest.Name = "Ping";
var rpcResponse = await client.RpcAsync(rpcRequest);
if (rpcResponse.Error == null)
{
Console.WriteLine("✅ Server is up and running!");
}
// Parameterized RPC example
var request = client.PrepareParameterizedRpc();
request.Name = "CustomFields";
request.Action = "getCustomTableData";
request.Parameters = new Dictionary<string, object>
{
{ "customTableName", "YourTableName" }
};
var response = await client.RpcAsync<CustomTableMetaData>(request);
if (response.Error == null && response.Data != null)
{
Console.WriteLine($"Custom table: {response.Data.TableName}");
}
Batch Operations
Execute multiple CRUD and/or RPC operations in a single HTTP request. On the live Fiix API the entire batch is transactional — if any operation fails, all are rolled back.
var batch = client.PrepareBatch();
// Queue a find
var findReq = client.PrepareFind<Asset>();
findReq.Fields = "id, strName";
findReq.Limit = 10;
batch.Requests.Add(findReq);
// Queue an RPC call
var pingReq = client.PrepareRpc();
pingReq.Name = "Ping";
batch.Requests.Add(pingReq);
var response = await client.BatchAsync(batch);
foreach (var sub in response.Responses ?? [])
{
if (sub.Error != null)
{
Console.WriteLine($"Sub-request error: {sub.Error.Message}");
continue;
}
// sub.Objects -> JsonElement[]? (for CRUD find results)
// sub.TotalObjects -> int? (total matching records)
Console.WriteLine($"Success — {sub.TotalObjects ?? 0} total record(s)");
}
Keep batches to 10–50 operations for best performance. Responses are ordered to match requests.
Note: For runnable examples see the CLI tool in
FiixCmms.Client.Cli/Examples/.
Configuration
Testing JSON Serialization
Before using with the real API, verify JSON output matches expectations:
using FiixCmms.Client.Diagnostics;
SerializationDiagnostics.TestWorkOrderSerialization();
SerializationDiagnostics.TestFindByIdRequestSerialization();
SerializationDiagnostics.TestPropertyNaming();
// Outputs the actual JSON payload so you can verify:
// strCode: "WO-001" ✓ (not StrCode)
// intSiteID: 1 ✓ (not intSiteId)
Microsoft DI / IHttpClientFactory (recommended for ASP.NET Core & hosted apps)
Use AddFiixClient() to register the client with IServiceCollection. This wires up
IHttpClientFactory under the hood — preventing socket exhaustion from new HttpClient()
being instantiated per-request.
// Program.cs / Startup.cs
builder.Services.AddFiixClient(options =>
{
options.AppKey = builder.Configuration["Fiix:AppKey"]!;
options.AccessKey = builder.Configuration["Fiix:AccessKey"]!;
options.SecretKey = builder.Configuration["Fiix:SecretKey"]!;
options.BaseUri = builder.Configuration["Fiix:BaseUri"]!;
options.Timeout = TimeSpan.FromSeconds(30); // optional, default 30s
});
Then inject FiixCmmsClient directly — no factory or manual wiring needed:
public class AssetService(FiixCmmsClient client)
{
public async Task<List<Asset>> GetAllAsync(CancellationToken ct = default)
{
var request = client.PrepareFind<Asset>();
request.Fields = "id, strName";
var response = await client.FindAsync(request, ct);
return response.Objects ?? [];
}
}
Manual / console / test usage (no DI)
var credentials = new BasicCredentials(appKey, accessKey, secretKey);
var client = new FiixCmmsClient(credentials, baseUri);
Or using FiixCmmsOptions without DI:
var client = new FiixCmmsClient(new FiixCmmsOptions
{
AppKey = appKey,
AccessKey = accessKey,
SecretKey = secretKey,
BaseUri = baseUri
});
Custom HTTP Client
var httpClient = new HttpClient { Timeout = TimeSpan.FromSeconds(30) };
var client = new FiixCmmsClient(credentials, baseUri)
{
Transport = new HttpTransport(httpClient)
};
Throttle Handling
The client automatically retries on HTTP 429 responses up to MaxWaitOnThrottleMs total:
var client = new FiixCmmsClient(credentials, baseUri)
{
MaxWaitOnThrottleMs = 10000 // default: 5000ms
};
Cancellation
All async methods accept an optional CancellationToken. Pass one to support cancel buttons, request timeouts, or application shutdown:
// WPF / UI — cancel button
var cts = new CancellationTokenSource();
cancelButton.Click += (_, _) => cts.Cancel();
var response = await client.FindAsync(request, cts.Token);
if (response.Error != null)
{
if (response.Error.Leg == "CLIENT_REQUEST_CANCELLED")
Console.WriteLine("Request was cancelled.");
else if (response.Error.Leg == "CLIENT_REQUEST_SEND_OR_RECEIVE")
Console.WriteLine("Request timed out.");
}
// Timeout — cancel after 10 seconds
using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(10));
var response = await client.FindAsync(request, cts.Token);
Cancellation is reflected in response.Error.Leg:
Leg value |
Meaning |
|---|---|
CLIENT_REQUEST_CANCELLED |
CancellationToken was signalled by the caller |
CLIENT_REQUEST_SEND_OR_RECEIVE |
HttpClient timeout (no token, or token not yet cancelled) |
Cancellation never throws — it always returns a response with Error set, so existing error-checking code works unchanged.
Error Handling
Every response derives from Response and exposes ApiError? Error. Always check it before accessing result properties:
var response = await client.FindByIdAsync(request);
if (response.Error != null)
{
Console.WriteLine($"Leg: {response.Error.Leg}");
Console.WriteLine($"Code: {response.Error.Code}");
Console.WriteLine($"Message: {response.Error.Message}");
return;
}
// Safe to use response.Object here
| Property | Type | Description |
|---|---|---|
Leg |
string? |
Where in the pipeline the error occurred |
Code |
int |
Numeric error code (429 = throttled) |
Message |
string? |
Human-readable description |
Object |
Dictionary<string, object>? |
Additional error metadata |
Available Models
107 DTO classes covering all major Fiix CMMS entities, all inheriting from ClientCmmsDto:
| Category | Models |
|---|---|
| Assets | Asset, AssetCategory, AssetClassification, AssetResolved, … |
| Work Orders | WorkOrder, WorkOrderStatus, WorkOrderTask, WorkOrderPart, … |
| Maintenance | ScheduledMaintenance, MaintenanceType, MeterReading, … |
| Purchasing | PurchaseOrder, PurchaseOrderLineItem, Receipt, Stock, … |
| Users | User, Business, RegionUser, SiteUser, … |
| Calendar | CalendarEvent, Dashboard, DashboardWidget, … |
All DTOs expose Dictionary<string, object>? ExtraFields for API fields not yet modelled and for dv_-prefixed display values.
Field Naming Convention
The Fiix API uses Hungarian notation. .NET properties use PascalCase and are serialized back to their original form by FiixPropertyNamingPolicy:
| Prefix | Type | JSON field | .NET property |
|---|---|---|---|
int |
Integer | intSiteID |
IntSiteID |
str |
String | strName |
StrName |
dtt |
DateTime | dttDateCreated |
DttDateCreated |
bol |
Boolean | bolIsActive |
BolIsActive |
dbl |
Double | dblHourlyRate |
DblHourlyRate |
qty |
Quantity | qtyOnHand |
QtyOnHand |
Display Values
Request dv_-prefixed fields to get human-readable names for foreign-key fields:
request.Fields = "id, strName, intCategoryID, dv_intCategoryID";
// asset.IntCategoryID => 5
// asset.ExtraFields["dv_intCategoryID"] => "Pumps"
Architecture
FiixCmms.Client/
├── FiixCmmsClient.cs Main client facade
├── BasicCredentials.cs ICredentials implementation
├── Api/
│ ├── Request.cs Base request class
│ ├── Response.cs Base response class (ApiError? Error)
│ ├── ApiError.cs Error details
│ ├── Crud/
│ │ ├── FindByIdRequest/Response
│ │ ├── FindRequest/Response (includes FindFilter, TotalObjects)
│ │ ├── AddRequest/Response
│ │ ├── ChangeRequest/Response (includes ChangeFields)
│ │ └── RemoveRequest/Response
│ ├── Rpc/
│ │ ├── RpcRequest/Response
│ │ ├── ParameterizedRpcRequest/Response<T>
│ │ └── PagedResponse<T>
│ └── Batch/
│ ├── BatchRequest List<Request> Requests
│ ├── BatchResponse List<SubResponse> Responses
│ └── SubResponse Error + Objects (JsonElement[]?) + TotalObjects (int?)
├── Models/ 107 DTO classes + ClientCmmsDto base
├── Interfaces/ ICredentials, ITransport, IFormat
├── Transport/ HttpTransport (injectable)
├── Format/ JsonFormat + FiixPropertyNamingPolicy
├── Diagnostics/ SerializationDiagnostics
└── Helpers/ UrlEncodingHelper
Requirements: .NET 10 · System.Text.Json (inbox) · System.Net.Http (inbox)
Resources:
MVVM / UI Integration
All model classes (everything under Models/) are declared partial, so you can extend them in your own project without subclassing.
The recommended pattern for MVVM frameworks such as CommunityToolkit.Mvvm is a thin ViewModel wrapper rather than making the model itself observable. This keeps serialization and UI concerns separate:
// ViewModel wraps the API model — clean separation of concerns
public partial class AssetViewModel : ObservableObject
{
private readonly Asset _asset;
public AssetViewModel(Asset asset) => _asset = asset;
[ObservableProperty]
private string _name = asset.StrName ?? string.Empty;
[ObservableProperty]
private string _description = asset.StrDescription ?? string.Empty;
// Write changes back to the model before calling ChangeAsync
public Asset ToModel()
{
_asset.StrName = Name;
_asset.StrDescription = Description;
return _asset;
}
}
The partial keyword also lets you add helper properties or methods directly on the model class in your own codebase if a wrapper is overkill for your use case:
// In your project — not in this library
public partial class Asset
{
public string DisplayLabel => $"[{intSiteId}] {StrName}";
}
Coming from the Java SDK?
This library is a direct .NET port of the official Fiix Java client. The official API documentation and Java examples apply directly — you just need these translation rules:
Field names — identical
All DTO field names are identical to the Java SDK (strName, intSiteID, bolIsOnline, etc.). No translation needed.
Properties instead of getters/setters
// Java
asset.setStrName("Delorean");
String name = asset.getStrName();
// C#
asset.StrName = "Delorean";
string name = asset.StrName;
Async instead of synchronous calls
// Java
AddResponse<Asset> response = client.add(request);
// C#
var response = await client.AddAsync(request);
Prepare* helpers instead of new Request<>()
// Java
AddRequest<Asset> req = new AddRequest<>();
req.setClassName("Asset");
req.setFields("id, strName");
req.setObject(asset);
// C#
var req = client.PrepareAdd<Asset>();
req.Fields = "id, strName";
req.Object = asset;
The Prepare* helpers set ClassName automatically from the generic type — no manual string required.
Error checking — same shape
// Java
if (response.getError() == null) { ... }
// C#
if (response.Error == null) { ... }
Official references
Release
Pushing a v* tag (e.g. v1.0.1-rc2) triggers .github/workflows/publish.yml which:
- Builds and packs the library targeting net8 and net10
- Creates a GitHub Release and attaches the
.nupkgand binary ZIP as artifacts - Publishes to NuGet.org via OIDC Trusted Publishing (
NuGet/login@v1) — no stored API key required
See CHANGELOG.md for release history and CONTRIBUTING.md for the full release and contribution workflow.
License
This project is licensed under the Apache License 2.0. See the LICENSE file for the full text.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.Extensions.Http (>= 9.0.0)
-
net8.0
- Microsoft.Extensions.Http (>= 9.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.