For the latest stable version, please use Unifly Services v4.7!

Create Operation Example

Here’s a basic example of how to create a new operation using curl:

#!/bin/bash

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

# Create new operation
curl -X POST "${BASE_URL}/uas/${SERIAL_NUMBER}/operations" \
     -H "apikey: ${API_KEY}" \
     -H "Content-Type: application/json" \
     -d '{
       "type": "Feature",
       "properties": {
         "description": "Roof inspection at the train station",
         "volume": {
           "start": "2024-01-23T10:00:00Z",
           "end": "2024-01-23T11:00:00Z",
           "maxAltitude": 120
         },
       "geometry": {
         "type": "Polygon",
         "coordinates": [[
           [4.401394, 51.217974],
           [4.401394, 51.218974],
           [4.402394, 51.218974],
           [4.402394, 51.217974],
           [4.401394, 51.217974]
         ]]
       }
     }' \
     -v

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

  • Replace your-api-key-here and your-drone-serial-number with your actual values

  • Adjust the operation time window in the volume object

  • Update coordinates in both markers and geometry to match your actual operation area

  • The operation area is defined as a GeoJSON polygon

Example response:

{
  "operationId": "e560fa10-0bd7-4d77-852b-3e2025748ceb",
  "portalUrl": "http://localhost:9001/#//0f40dfe5-a80c-40eb-b9b2-f61248e39064/uasoperation/e560fa10-0bd7-4d77-852b-3e2025748ceb/detailsv2"
}

The operation is created in DRAFT status. You’ll need to request acceptance and activation before flying.