Skip to main content

C# / .NET SDK

dotnet add package Noxdren --version 0.2.0

Requires .NET 8+.

Quickstart​

using Noxdren;

using var client = new NoxdrenClient("ndx_..."); // from app.noxdren.com

// Range rings
var r = await client.RangeIq.AnalyzeAsync(new RangeIqRequest
{
UserLat = 37.5,
UserLon = -122.3,
SelectedDroneKey = "mavic3pro",
WindSpeed = 6.0, // km/h in the default metric unit mode
WindDirection = 270,
});
foreach (var ring in r.Obj("result")!.List("rings"))
Console.WriteLine($"{ring.Str("label")} @ {ring.Num("battery_threshold_pct")}%");

// Multi-leg mission (a catalog key is enough; the API fills in that
// aircraft's full profile)
var m = await client.Missions.AnalyzeGeometryAsync(new MissionRequest
{
HomeLat = 37.5,
HomeLon = -122.3,
DroneKey = "mavic3pro",
Waypoints = new List<Waypoint>
{
new() { Lat = 37.50, Lon = -122.30, AltitudeM = 80 },
new() { Lat = 37.52, Lon = -122.31, AltitudeM = 100 },
},
Weather = new Weather { WindSpeedMps = 6.0, WindDirDeg = 270 },
});
Console.WriteLine(m.Obj("result")!.Str("mission_verdict"));

// Options, a calibrated profile, and a flight-plan file
var profile = new Dictionary<string, object?>((await client.Drones.GetAsync("air3")).Obj("drone")!.Raw)
{
["cruise_speed_mps"] = 7.25, // your calibrated value
};
var f = await client.Missions.AnalyzeAsync(new MissionFileRequest
{
MissionFile = File.ReadAllBytes("route.kmz"), // DJI WPML/KMZ, KML/KMZ, GPX, Litchi CSV
FileName = "route.kmz",
HomeLat = 37.5,
HomeLon = -122.3,
DroneProfile = profile,
Battery = new Battery { InitialPct = 95, RthThresholdPct = 25, Cycles = 40 },
Options = new MissionOptions { PayloadG = 0, TerrainPolicy = "fail" },
});

MissionOptions covers PayloadG, AltPenalty, FineTuneFactor, PreflightHoverS, GlobalCruiseMps, SmartRthEnabled, UseLiveWeather, and TerrainPolicy ("warn" default, or "fail" for a retryable 503 instead of substituted terrain). MissionRequest also takes Options and DroneProfile. Options, profiles and file upload need SDK 0.2.0 or later.

Read responses with typed navigation (r.Obj("result")!.List("rings")[0].Str("label")) or r.Raw for the parsed dictionary.

Error handling​

try
{
await client.RangeIq.AnalyzeAsync(req);
}
catch (AuthenticationException) { /* 401 */ }
catch (ValidationException e) { Console.WriteLine($"{e.Code} {e.Message}"); /* 400/422 */ }
catch (RateLimitException e) { Console.WriteLine($"retry after {e.RetryAfter}s"); /* 429 */ }
catch (NoxdrenException e) { Console.WriteLine($"{e.Code} {e.RequestId}"); /* catch-all */ }

Transient errors retry automatically (backoff honoring Retry-After); tune via the maxRetries constructor argument.

Configuration​

new NoxdrenClient(
apiKey: "ndx_...",
baseUrl: "https://api.noxdren.com",
timeoutSeconds: 30,
maxRetries: 2);

Coverage​

MethodEndpoint
client.Drones.ListAsync() / .GetAsync(key)GET /v1/drones, /v1/drones/{key}
client.RangeIq.AnalyzeAsync(...)POST /v1/rangeiq/analyze
client.Missions.AnalyzeGeometryAsync(...)POST /v1/missions/analyze-geometry
client.Missions.AnalyzeAsync(...)POST /v1/missions/analyze (file upload)
client.HealthAsync() / .VersionAsync()GET /v1/health, /v1/version

See the API reference for every field.