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

ParameterDescriptionOptionalExample

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:

CodeDetailsMessage

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"
}

'

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:

ParameterDescription

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".

Last updated