Register UAS Example

Here’s a basic example of how to register a new UAS using curl:

#!/bin/bash

# Base variables
API_KEY="your-api-key-here"
BASE_URL="https://portal.demo.unifly.tech/api/gcs"

# Register new UAS
curl -X POST "${BASE_URL}/uas" \
     -H "apikey: ${API_KEY}" \
     -H "Content-Type: application/json" \
     -d '{
       "generalFeatures": {
         "brand": "GCS MANU",
         "model": "GCS model",
         "type": "ROTARY_WING",
         "numberOfRotors": 4,
         "weight": 2,
         "width": 2,
         "height": 2,
         "length": 2,
         "wingspan": 2,
         "bodyMaterial": "Aluminum"
       },
       "flightFeatures": {
         "maxFlightTime": 2,
         "payloadCapacity": 1.99,
         "mtom": 2,
         "maximumAltitude": 200,
         "maximumSpeed": 2,
         "minimumOperatingTemperature": 0,
         "maximumOperatingTemperature": 32
       },
       "controllerFeatures": {
         "operatingRange": 50,
         "controllerFrequency": 2,
         "controlSystem": "Remote Control + Phone/Tablet"
       },
       "serialNumber": "DRONE123",
       "nickname": "My Drone"
     }' \
     -v

The -v flag enables verbose output, showing the full HTTP request and response including headers.

Replace your-api-key-here with your actual API key and modify the UAS specifications according to your drone’s characteristics.