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

Add Drone

"Seamlessly integrate new drones into your system with Aeromegh's addDrone API."

This API provides programmatic access to add a new drone to the system with secure API key authentication for authorized users.

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

droneID

Unique identifier for the drone.

No

droneName

Name assigned to the drone.

No

uin

Unique Identification Number of the drone.

No

model

Model of the drone.

Yes

serialNo

Serial number of the drone.

Yes

fcsNo

Flight control system number of the drone.

Yes

rcsNo

Remote control system number of the drone.

Yes

board_type

Type of board used in the drone.

Yes

green_build_number

Build number for the green version.

Yes

device_ram

RAM capacity of the device.

Yes

android_version

Version of the Android operating system.

Yes

device_model_name

Model name of the device.

Yes

firmware_version

Version of the drone's firmware.

Yes

license_type

Type of license associated with the drone.

Yes

HTTP Request

https://ags.aeromegh.com/Aeromegh/addDrone?${teamId}

URL Parameters

URL Parameters are:

Parameter
Description

teamID

Unique identifier for the team managing the drones.

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/addDrone?teamId=a16afc9b-5205-4fa5-8c42-6276ce1e3281' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <API_KEY>' \
--data '{
    "droneID": "P000010024003B3131510137381045",
    "droneName": "testapi",
    "uin": "BTASD123DB746",
    "model": "134", 
    "serialNo": "34665dffd4554", 
    "fcsNo": "dgf34554", 
    "rcsNo": "ws43433", 
    "board_type": "cubeOrangePlus", 
    "green_build_number": "103.265.20240425.01", 
    "device_ram": "12GB", 
    "android_version": "Android 9", 
    "device_model_name": "QUALCOMM MK15", 
    "firmware_version": "4.4.4", 
    "license_type": "OEM" 
}'
//Please install 'axios' module first
//Set your API key before making the request
const axios = require('axios');
let data = JSON.stringify({
  "droneID": "P000010024003B3131510137381045",
  "droneName": "testapi",
  "uin": "BTASD123DB746",
  "model": "134",
  "serialNo": "34665dffd4554",
  "fcsNo": "dgf34554",
  "rcsNo": "ws43433",
  "board_type": "cubeOrangePlus",
  "green_build_number": "103.265.20240425.01",
  "device_ram": "12GB",
  "android_version": "Android 9",
  "device_model_name": "QUALCOMM MK15",
  "firmware_version": "4.4.4",
  "license_type": "OEM"
});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://ags.aeromegh.com/Aeromegh/addDrone?teamId=a16afc9b-5205-4fa5-8c42-6276ce1e3281',
  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/addDrone?teamId=a16afc9b-5205-4fa5-8c42-6276ce1e3281"

payload = json.dumps({
  "droneID": "P000010024003B3131510137381045",
  "droneName": "testapi",
  "uin": "BTASD123DB746",
  "model": "134",
  "serialNo": "34665dffd4554",
  "fcsNo": "dgf34554",
  "rcsNo": "ws43433",
  "board_type": "cubeOrangePlus",
  "green_build_number": "103.265.20240425.01",
  "device_ram": "12GB",
  "android_version": "Android 9",
  "device_model_name": "QUALCOMM MK15",
  "firmware_version": "4.4.4",
  "license_type": "OEM"
})
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" : "Drone has been registered"
}

API Response Parameter

Following parameter is included in API response:

Parameter
Description

message

returned message indicating response

PreviousGet End FlightNextGet All Reports

Last updated 11 months ago

Was this helpful?