Request Landing Example

Here’s a basic example of how to request landing 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"

# Request landing
curl -X POST "${BASE_URL}/uas/${SERIAL_NUMBER}/landing" \
     -H "apikey: ${API_KEY}" \
     -H "Content-Type: application/json" \
     -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

  • UAS must be in flight status (after take-off)

  • Landing should be declared even in emergency situations

Example successful response:

{
  "flightId": "FLIGHT_123456",
  "operationId": "OP_123456"
}

Possible response codes:

  • 200: Landing successfully registered

  • 401: The API key is missing

  • 403: The API key was not recognized or you’re not allowed to perform a landing for that UAS

  • 404: The given serial number could not be found or the UAS does not belong to your operator company

  • 409: The UAS could not be landed

If you receive a 409 response, the response body will include details:

{
  "message": "The UAS could not be landed",
  "operationId": "OP_123456"
}

Common reasons for landing rejection:

  • UAS is not in flight (ALREADY_LANDED)

  • Landing location outside operation area