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
  • HTTP Response
  • Code Snippet
  • API Response
  • API Response Parameter

Was this helpful?

  1. AeroGCS Enterprise APIs

Add Flight Log

"Effortlessly record and manage drone flight data with Aeromegh's addFlightLog API endpoint."

This API provides programmatic access for adding flight log entries with secure API key authentication. It records essential telemetry data and other relevant information, creating a comprehensive record of drone operations.

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

POST

Post Data Parameters

Parameter
Description
Optional
Example

droneID

Unique identifier for the drone.

No

P00001004F002B3131510137383337

teleData

Telemetry data collected during the flight.

No

See example JSON object below

flightID

Unique identifier for the flight.

No

ebddac29-c44d-481e-90ff-48a344080fa8

key

Key indicating the type of telemetry data.

No

AS_TELE_DATA

aerostackID

Unique identifier for the Aerostack system.

No

999e8416-d5af-4828-8c44-a83f1e556d4e

timestamp

Timestamp indicating when the telemetry data was received.

No

1715083563

Example of the teleData object:

{
    "alt": 1.37,
    "bat": "43.631",
    "dir": "18.00",
    "flowRate": "0.00",
    "lat": 28.9852907,
    "liquidConsumed": "00",
    "liveObstacleDistance": "2.5",
    "lon": 78.0017839,
    "mod": "16",
    "pit": -1.6977644338993196,
    "rol": 0.7457296585355124,
    "sat": 28,
    "sprayPumpRate": "41",
    "sprayedArea": "0.0000",
    "sprayedDistance": "1283.448",
    "vel": 0.05128028988838196,
    "yaw": 18.24909237728412
}

HTTP Request

https://ags.aeromegh.com/Aeromegh/addFlightLog

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/addFlightLog' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <API_KEY>' \
--data '{
    "droneID": "P00001004F002B3131510137383337",
    "teleData": {"alt":1.37,"bat":"43.631","dir":"18.00","flowRate":"0.00","lat":28.9852907,"liquidConsumed":"00","liveObstacleDistance":"2.5","lon":78.0017839,"mod":"16","pit":-1.6977644338993196,"rol":0.7457296585355124,"sat":28,"sprayPumpRate":"41","sprayedArea":"0.0000","sprayedDistance":"1283.448","vel":0.05128028988838196,"yaw":18.24909237728412},
    "flightID": "ebddac29-c44d-481e-90ff-48a344080fa8",
    "key": "AS_TELE_DATA",
    "aerostackID":"999e8416-d5af-4828-8c44-a83f1e556d4e",
    "timestamp":"1715083563"
}

'
//Please install 'axios' module first
//Set your API key before making the request
const axios = require('axios');
let data = JSON.stringify({
  "droneID": "P00001004F002B3131510137383337",
  "teleData": {
    "alt": 1.37,
    "bat": "43.631",
    "dir": "18.00",
    "flowRate": "0.00",
    "lat": 28.9852907,
    "liquidConsumed": "00",
    "liveObstacleDistance": "2.5",
    "lon": 78.0017839,
    "mod": "16",
    "pit": -1.6977644338993196,
    "rol": 0.7457296585355124,
    "sat": 28,
    "sprayPumpRate": "41",
    "sprayedArea": "0.0000",
    "sprayedDistance": "1283.448",
    "vel": 0.05128028988838196,
    "yaw": 18.24909237728412
  },
  "flightID": "ebddac29-c44d-481e-90ff-48a344080fa8",
  "key": "AS_TELE_DATA",
  "aerostackID": "999e8416-d5af-4828-8c44-a83f1e556d4e",
  "timestamp": "1715083563"
});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://ags.aeromegh.com/Aeromegh/addFlightLog',
  headers: { 
    'Content-Type': 'application/json', 
    'Authorization': 'Bearer <API_KEY>'
  },
  data : data
};

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

url = "https://ags.aeromegh.com/Aeromegh/addFlightLog"

payload = json.dumps({
  "droneID": "P00001004F002B3131510137383337",
  "teleData": {
    "alt": 1.37,
    "bat": "43.631",
    "dir": "18.00",
    "flowRate": "0.00",
    "lat": 28.9852907,
    "liquidConsumed": "00",
    "liveObstacleDistance": "2.5",
    "lon": 78.0017839,
    "mod": "16",
    "pit": -1.6977644338993196,
    "rol": 0.7457296585355124,
    "sat": 28,
    "sprayPumpRate": "41",
    "sprayedArea": "0.0000",
    "sprayedDistance": "1283.448",
    "vel": 0.05128028988838196,
    "yaw": 18.24909237728412
  },
  "flightID": "ebddac29-c44d-481e-90ff-48a344080fa8",
  "key": "AS_TELE_DATA",
  "aerostackID": "999e8416-d5af-4828-8c44-a83f1e556d4e",
  "timestamp": "1715083563"
})
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer <API_KEY>'
}

response = requests.request("POST", 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 log added"
}

API Response Parameter

The API response contains the following parameters:

Parameter
Description

message

A message indicating the result of the operation. In this case, it confirms that the flight log has been successfully added to the Aeromegh system. The value will be "Flight log added".

PreviousGet All PesticidesNextAdd Offline Flight Logs

Last updated 11 months ago

Was this helpful?