Airspace Management

2026-09-20

Feature Description

After enabling real-time airspace data reporting, you can obtain a Webhook URL and an encryption token from your service provider. After entering and saving them, the FlightHub API can push real-time aircraft data to third parties. The following is the integration guide for third-party service providers.

Integration Guide

Data Reporting Protocol

1. Request Header

Field NameField CodeData TypeDescriptionRequired
Data SourcesourceInteger1: Reported directly by aircraft
2: Reported by manufacturer's system
3: Reported by add-on module
4: Reported by collection device
Yes
Reporting PlatformplatformStringPlatform name (e.g., DJI Fly)Yes
Program VersionprogramVersionStringVersion number (e.g., version 1.0)Yes
SignaturesignatureStringThe generated request signatureYes
Request timestamptimestampStringRequest Unix timestamp (in seconds)Yes
NoncenonceStringA randomly generated stringYes
Signature Generation Process

Input Parameters

  • token: Application key (provided by the integrated service provider and configured by the user in FlightHub 2). Must be 32-64 characters long and consist of a combination of at least three of the following types: letters, numbers, and special symbols.
  • timestamp: Request timestamp (from the timestamp request header)
  • nonce: Random string (from the nonce request header)
  • body: Raw byte data of the request body (e.g., the JSON-serialized RequestBody)

Signature Rules

  1. Concatenate timestamp, nonce, and body into a single string in that order (without separators).
  2. Use the HMAC-SHA256 algorithm with the token as the key to encrypt the concatenated string.
  3. Convert the encrypted result to a lowercase hexadecimal string.

Go Code Implementation

import (
    "crypto/hmac"
    "crypto/sha256"
    "crypto/subtle"
    "encoding/hex"
)

func GenerateHMACSignature(appKey, timestamp, nonce string, body []byte) string {
    mac := hmac.New(sha256.New, []byte(appKey))
    mac.Write([]byte(timestamp))
    mac.Write([]byte(nonce))
    mac.Write(body)
    return hex.EncodeToString(mac.Sum(nil))
}
Signature Verification Process

Verification Logic

  1. The server retrieves the following from the request header:
    • signature: The signature generated by the client
    • timestamp: The request timestamp
    • nonce: The random string
  2. The server regenerates a signature using the same parameters and the secret key appKey.
  3. Use a constant-time comparison to verify if the client's signature matches the one generated by the server.

Go Code Implementation

func VerifyHMACSignature(appKey, timestamp, nonce string, body []byte, signature string) bool {
    expected := GenerateHMACSignature(appKey, timestamp, nonce, body)
    return subtle.ConstantTimeCompare([]byte(expected), []byte(signature)) == 1
}

2. Request Body

JSON format

{
  "app_id":"default",
   "flight_hub_organization_id":"xxxx",
  "paths": [
    { /* FlightPath object */ },
    { /* FlightPath object */ }
  ]
}

Field Descriptions

FieldTypeRequiredDescription
app_idstringYesUnique application identifier. Currently defaults to default.
flight_hub_organization_idstringYesUser's FlightHub organization ID
pathsFlightPath[]YesArray of flight path data (see object structure below)
FlightPathRecord Structure Description

This structure is used to describe flight path point data. The following are detailed field descriptions:

No.Field NameField CodeData TypeDescriptionRequired
1Flight Record IDorder_idStringFormat: Manufacturer Serial Number (sn)-8-digit takeoff date (YYYYMMDD)-8-digit random code.
Example: 1581F5FHD25G100C1SDN-20240320-owvGyLqe.
The same ID is used throughout the entire flight.
Yes
2Aircraft Serial NumbersnStringManufacturer's aircraft production SNYes
3Flight Statusflight_statusStringTakeOff: takeoff point, Inflight: In flight, Land: Landing pointYes
4Unified Social Credit Codemanufacturer_idStringThe manufacturer's Unified Social Credit Code.Yes
5CAAC Real-name Registration Numberuas_idStringIf there is no registration number, use the default value UAS-DEFAULT.Yes
6Current Timestamptime_stampStringUTC+8 time, format: yyyyMMddHHmmss. Example: 20240124095001Yes
7Product Modeluas_modelStringA combination of letters, numbers, and/or symbols.Yes
8Coordinate System TypecoordinateInteger1: WGS-84
2: CGCS2000
3: GLONASS-PZ90
Yes
9LongitudelongitudeLongUnit: degrees (°). Actual value = field value / 10⁷.Yes
10LatitudelatitudeLongUnit: degrees (°). Actual value = field value / 10⁷.Yes
11True Height Typeheight_typeInteger1: Altitude relative to takeoff point (ALT)
2: Altitude relative to current position (AGL)
Yes
12True HeightheightIntegerUnit: meters (m). Actual value = field value / 10.Yes
13AltitudealtitudeIntegerUnit: meters (m). Actual value = field value / 10.Yes
14Vertical SpeedvsIntegerUnit: m/s. Actual value = field value / 10.Yes
15Horizontal Flight SpeedgsIntegerUnit: m/s. Actual value = field value / 10.Yes
16CoursecourseIntegerAngle clockwise from True North (0°-360°). Actual value = field value / 10. Fill with -999 when no data is available.Yes
17RID Broadcast Statusremote_id_statusInteger0: Disabled  
1: Enabled
Yes

Body Example:

{
	"app_id": "default",
	"flight_hub_organization_id": "105ddf05-54ce-4626-a872-cb32b8c98864",
	"paths": [{
		"order_id": "1529F6QAD23CB00A42DP-20251028-89W2aK2W",
		"sn": "1529F6QAD23CB00A42DP",
		"flight_status": "Land",
		"manufacturer_id": "925413007954257495",
		"uas_id": "UAS-DEFAULT",
		"time_stamp": "20251028115000",
		"uas_model": "M3D",
		"coordinate": 1,
		"longitude": 1243579943,
		"latitude": 217931488,
		"height_type": 1,
		"height": 0,
		"altitude": 187,
		"vs": 0,
		"gs": 0,
		"course": 1229,
		"remote_id_status": 1
	}]
}

3. Response Body

Field NameField CodeData TypeDescription
Status CodecodeString0 = Success, 400 = Failure
Result DescriptionresultStringDetailed description (e.g., success)

Response Example:

{
  "code": "0",
  "result": "success"
}
Last Updated: