Get Flight Logs

API is a service that allows users to retrieve historical flight logs recorded by a drone during its missions. These logs typically contain detailed information about the drone's flight.

This API provides programmatic access to detailed drone operation information, including telemetry data and flight statuses. Integrate with this API to efficiently retrieve logs for analysis, monitoring, and reporting.

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 : get flight log

HTTP Request

https://ags.aeromegh.com/AeroMegh/AeroStack/flightLogs/${pageSize}/${offset}?flightID=${flightid}&keys=${keys}

Query Parameters

Query Parameters are

KeyDescription

Flight_ID

take id from get flights API response

keys

AS_FLIGHT_LOG/AS_TELE_DATA/AS_KEEP_ALIVE

URL Parameters

URL parameters are

KeyDescription

pageSize :

20 records on each page

offset :

page size * page number

HTTP Response

Response codes explanation:

CodeDetails

200

message: "ok"

400

request parameters missing

500

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/AeroStack/flightLogs/${pageSize}/${pageNumber}?flightID=${flightid}&keys=${keys} ' \
--header 'Authorization: Bearer <API_key>'
           

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

Usage Note : To specify the type of data you wish to retrieve from the API, set the key accordingly:

  • For accessing flight logs, use the key AS_FLIGHT_LOG.

  • To retrieve telemetry data, set the key as AS_TELE_DATA.

  • For obtaining keep-alive signals, utilize the key AS_KEEP_ALIVE.

Remember, you can only set one key at a time to specify the type of data you want to receive. Choose between AS_FLIGHT_LOG, AS_TELE_DATA, or AS_KEEP_ALIVE based on your requirements.

API Response

Example of API Response in JSON format.

            
              {
                "logs": [
                    {
                        "id": "c50087e9-11b7-48dd-b3f2-f6627abd24f4",
                        "key": "AS_TELE_DATA",
                        "droneid": "P00001DESKTOP-E762V7V",
                        "timestamp": "2023-08-19T12:16:08.000Z",
                        "aerostackid": "21baf594-0400-4afa-a214-dff78990751e",
                        "data": "{\"alt\":\"0.0\",\"bat\":\"12.587\",\"dir\":\"178.00\",\"lat\":\"-35.3638563\",\"lon\":\"149.1655674\",\"mod\":\"4\",\"pit\":\"-0.1300536986872789\",\"rol\":\"-0.6019573781579175\",\"sat\":\"10\",\"vel\":\"0.01667754352092743\",\"yaw\":\"178.28035462124387\",\"timestamp\":\"1692447368\",\"liquidConsumed\":\"00\",\"remainingLiquidPercentage\":\"0\",\"sprayedArea\":\"0.0000\",\"sprayedDistance\":\"0.000\",\"sprayPumpRate\":\"10\",\"flowRate\":\"0\",\"liveObstacleDistance\":\"0\"}",
                        "flight_id": "923dbb64-39e5-4751-88ad-4ef3496f4afa",
                        "totalCount": {
                            "count": "1584"
                        }
                    },
                    {
                        "id": "6ec20f32-b516-4edd-890e-d32011a8dea5",
                        "key": "AS_TELE_DATA",
                        "droneid": "P00001DESKTOP-E762V7V",
                        "timestamp": "2023-08-19T12:16:08.000Z",
                        "aerostackid": "21baf594-0400-4afa-a214-dff78990751e",
                        "data": "{\"alt\":\"0.0\",\"bat\":\"12.587\",\"dir\":\"178.00\",\"lat\":\"-35.3638563\",\"lon\":\"149.1655674\",\"mod\":\"4\",\"pit\":\"-0.1300536986872789\",\"rol\":\"-0.6019573781579175\",\"sat\":\"10\",\"vel\":\"0.016485927626490593\",\"yaw\":\"178.28035462124387\",\"timestamp\":\"1692447368\",\"liquidConsumed\":\"00\",\"remainingLiquidPercentage\":\"0\",\"sprayedArea\":\"0.0000\",\"sprayedDistance\":\"0.000\",\"sprayPumpRate\":\"10\",\"flowRate\":\"0\",\"liveObstacleDistance\":\"0\"}",
                        "flight_id": "923dbb64-39e5-4751-88ad-4ef3496f4afa"
                    },
                    {
                        "id": "a3fb8377-da26-4fc4-94b2-9e78a69a08de",
                        "key": "AS_TELE_DATA",
                        "droneid": "P00001DESKTOP-E762V7V",
                        "timestamp": "2023-08-19T12:16:08.000Z",
                        "aerostackid": "21baf594-0400-4afa-a214-dff78990751e",
                        "data": "{\"alt\":\"0.0\",\"bat\":\"12.587\",\"dir\":\"178.00\",\"lat\":\"-35.3638563\",\"lon\":\"149.1655674\",\"mod\":\"4\",\"pit\":\"-0.1300536986872789\",\"rol\":\"-0.6019573781579175\",\"sat\":\"10\",\"vel\":\"0.016485927626490593\",\"yaw\":\"178.28035462124387\",\"timestamp\":\"1692447368\",\"liquidConsumed\":\"00\",\"remainingLiquidPercentage\":\"0\",\"sprayedArea\":\"0.0000\",\"sprayedDistance\":\"0.000\",\"sprayPumpRate\":\"10\",\"flowRate\":\"0\",\"liveObstacleDistance\":\"0\"}",
                        "flight_id": "923dbb64-39e5-4751-88ad-4ef3496f4afa"
                    }
                ]
            }

API Response Parameter

The following parameters are included in the API response for Flight logs

  • id : Unique identifier for the log

  • key : Key used to identify if the log entry contains telemetry data or flight data.

  • droneid : Unique identifier for the drone associated with this log entry

  • timestamp : Timestamp indicating the time when the telemetry data was recorded.

  • aerostackid : Identifier associated with an Aerostack system or component.

  • data : The actual drone data or information captured by the log entry.

    • Parameters and Units of Measurement

      The table below outlines the parameters included in the data along with their respective units of measurement:

ParameterUnit Of Measurement

alt

m (meter)

bat

v (volt)

dir

° (degrees)

lat

° (degrees)

lon

° (degrees)

mod

Return as numerical values, where the number represents

  1. Acro

  2. Airmode

  3. Alt Hold

  4. Auto

  5. AutoTune

  6. Brake

  7. Circle

  8. Drift

  9. Flip

  10. FlowHold

  11. Follow

  12. Guided

  13. Heli_Autorotate

  14. Land

  15. Loiter

  16. PosHold

  17. RTL

  18. SmartRTL

  19. Sport

  20. Stabilize

  21. SysID

  22. Throw

  23. Turtle

  24. ZigZag

pit

° (degrees)

rol

° (degrees)

sat

satellite count in number

vel

m/s (meter per second)

yaw

° (degrees)

timestamp

ms (milliseconds)

liquidConsumed

ml (milliliter)

remainingLiquidPercentage

% ( percentage)

sprayedArea

m² ( square meter)

sprayedDistance

m ( meter)

sprayPumpRate

% ( percentage)

flowRate

L/min ( liter per minute)

liveObstacleDistance

cm (centimeter)

  • flight_id : Identifier for a specific flight associated with this log entry.

Last updated