Introduction
The FlyNat API is a RESTful server built in Rust, running at api.flynat.net. It serves two audiences:
1. FlyNat Mobile App — manages pilot sessions, receives GPS telemetry, and exposes a live pilot feed for the map.
2. DJI Pilot 2 (Enterprise Drones) — implements the DJI Cloud API v2 protocol so that Mavic 3E, Matrice, and other enterprise DJI drones can connect directly and stream real-time OSD telemetry via MQTT.
Base URL & Connection
| Service | Address | Protocol |
|---|---|---|
| REST API | https://api.flynat.net | HTTPS / TLS 1.3 |
How It All Connects
The full data flow from a DJI enterprise drone to the UTM authority feed:
The FlyNat Mobile App connects via a parallel path — sharing the pilot's GPS location and creating sessions that get merged with DJI telemetry using the pilot's Firebase UID as the common identifier.
Pilot Sessions
Sessions track when a pilot is actively flying. The FlyNat Mobile App creates a session when SHARE MY LOCATION is activated.
Create Session
Creates a new pilot session. Called automatically by the FlyNat app when sharing starts.
{
"firebase_uid": "google-uid-123",
"pilot_name": "Avi Cohen",
"drone_model": "DJI Mavic 3E",
"altitude": 80,
"mission_type": "Survey"
}
{
"session_id": "uuid-v4",
"started_at": "2025-04-02T10:00:00Z"
}
End Session
Closes an active session. Called automatically when the pilot stops sharing location.
Live Pilots
Returns all pilots with an active session seen within the last 30 seconds.
[
{
"session_id": "uuid-v4",
"firebase_uid": "google-uid-123",
"pilot_name": "Avi Cohen",
"drone_serial": "1ZNBC8D0D10001",
"started_at": "2025-04-02T10:00:00Z",
"last_seen": "2025-04-02T10:15:30Z",
"active": true
}
]
UTM Feed (ASTM F3411)
The UTM feed exposes real-time drone telemetry in ASTM F3411-22a format. This endpoint is intended for aviation authorities (CAAA / רת"א) to monitor active drone operations.
[
{
"uas_id": "1ZNBC8D0D10001",
"timestamp": "2025-04-02T10:15:30Z",
"uas_location": {
"latitude": 32.0853,
"longitude": 34.7818,
"altitude_geo": 80.0,
"altitude_agl": 75.0
},
"uas_velocity": {
"speed": 8.2,
"track": 145.0
}
}
]
DJI Cloud API — Pilot Login
DJI Pilot 2 calls this endpoint when the pilot logs into the cloud server on the RC controller. The server verifies the credentials against Firebase and returns a session token.
{
"username": "google-uid-123", // Firebase UID from FlyNat App → Profile
"password": "FlyNat14chars" // Auto-generated password from FlyNat App → Profile
}
{
"code": 0,
"data": {
"token": "flynat-uuid-v4",
"user_id": "google-uid-123",
"username": "Avi Cohen",
"workspace_id": "flynat-workspace-001"
}
}
DJI Cloud API — Device Binding
When a drone powers on and connects to DJI Pilot 2, the app binds the drone serial number to the authenticated pilot. This creates a verified session linking pilot identity to drone.
{
"device_sn": "1ZNBC8D0D10001",
"device_name": "Mavic 3E - Unit 1"
}
Setting Up in FlyNat App
To connect DJI Pilot 2 to the FlyNat server, follow these steps:
- Install FlyNat MobileDownload and install the FlyNat LogBook app on your Android device. Sign in with your Google account.
- Open Your ProfileTap the Profile tab. You will see the DJI Cloud Credentials card with your auto-generated Username and Password.
- Copy the CredentialsTap the copy icon next to each field. These credentials are unique to your Google account and never change.
- Open DJI Pilot 2 on the RC ControllerGo to ··· → Cloud Services → Add Cloud Server.
- Enter Server DetailsServer URL:
https://api.flynat.net· Username and Password from your profile. - Power On Your DroneOnce connected, the drone automatically binds and begins streaming telemetry. Your pilot identity is verified in real-time.
DJI Credentials Explained
The credentials shown in the FlyNat app Profile screen are generated automatically from your Google account ID. They are deterministic — the same account always produces the same password.
| Field | Value | Notes |
|---|---|---|
| Username | Your Google Account ID | Unique Firebase UID |
| Password | 14-character auto-generated | Stored encrypted in Firebase |
| Server URL | https://api.flynat.net | Enter once in DJI Pilot 2 |