AeroGCS Enterprise API
  • AeroGCS Enterprise APIs
    • Get All Drones
    • Get All Drones Status
    • Get All Flights
    • Get Flight Logs
    • Get All Projects
    • Get Plans
    • Get Plan Data
    • Start Flight
    • Get End Flight
    • Add Drone
    • Get All Reports
    • Get All Customers
    • Get All Crops
    • Get All Pesticides
    • Add Flight Log
    • Add Offline Flight Logs
Powered by GitBook
On this page
  • Authentication
  • Method
  • HTTP Request
  • URL Parameters
  • HTTP Response
  • Code Snippet
  • API Response
  • API Response Parameter

Was this helpful?

  1. AeroGCS Enterprise APIs

Get End Flight

"Effortlessly manage flight sessions and retrieve essential data with Aeromegh's endFlight API."

This API facilitates programmatic access to flight session management, enabling authorized users to efficiently terminate flights and gather pertinent information for further analysis.

Authentication

To use the API, insert your API key in the Authorization header like this:

Authorization: Bearer <YOUR_API_KEY>

Replace <YOUR_API_KEY> with your AeroGCS API key. Without it, you'll get a 401 Unauthorized error.

Method

GET - Retrieve Flight Ended Status

HTTP Request

https://ags.aeromegh.com/Aeromegh/endFlight?flightId={flightId}&teamId={teamId}&distanceCovered={distanceCovered}&areaCovered={areaCovered}

URL Parameters

URL parameters are

Parameter
Description

flightId

Unique identifier for the flight session.

teamId

Unique identifier for the team managing the flight.

distanceCovered

Distance covered during the flight (in meters).

areaCovered

Area covered by the drone during the flight (in square meters).

HTTP Response

Response Codes Explanation:

Code
Details
Message

200

The request was successful.

"OK"

400

Request parameters missing.

"Request parameters missing"

500

Internal server error.

"Internal server error"

Code Snippet

Examples of how you can call this API using curl, Node.js, and Python

curl --location 'https://ags.aeromegh.com/Aeromegh/endFlight?flightId=1887ab99-f7e2-4926-b5f4-a6341c75e951&teamId=a16afc9b-5205-4fa5-8c42-6276ce1e3281&distanceCovered=12.5&areaCovered=25' \
--header 'Authorization: Bearer <API_KEY>'
//Please install 'axios' module first
//Set your API key before making the request
const axios = require('axios');

let config = {
  method: 'get',
  maxBodyLength: Infinity,
  url: 'https://ags.aeromegh.com/Aeromegh/endFlight?flightId=1887ab99-f7e2-4926-b5f4-a6341c75e951&teamId=a16afc9b-5205-4fa5-8c42-6276ce1e3281&distanceCovered=12.5&areaCovered=25',
  headers: { 
    'Authorization': 'Bearer <API_KEY>'
  }
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});
//Please install 'requests' package first
//Set your API key before making the request
import requests

url = "https://ags.aeromegh.com/Aeromegh/endFlight?flightId=1887ab99-f7e2-4926-b5f4-a6341c75e951&teamId=a16afc9b-5205-4fa5-8c42-6276ce1e3281&distanceCovered=12.5&areaCovered=25"

payload = {}
headers = {
  'Authorization': 'Bearer <API_KEY>'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)


Note: Replace <API_KEY> with the actual API_KEY provided by Aeromegh.

API Response

Example of API response in JSON format:

{
    "message": "Flight Ended."
}

API Response Parameter

The API response provides details about the flight session termination status, including the following parameter:

  • Message: A textual message indicating the status of the ended flight session.

PreviousStart FlightNextAdd Drone

Last updated 11 months ago

Was this helpful?