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 All Pesticides

"Unlock the power of pesticide data seamlessly with Aeromegh's pesticide API endpoint."

This API provides programmatic access to a list of all pesticides, including names, quantities, and other attributes, with secure API key authentication. Use it to seamlessly integrate pesticide data into applications.

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 : Retrieves a list of all pesticides.

HTTP Request

https://ags.aeromegh.com/Aeromegh/getAllPesticides?searchString={searchString}&fromDateTime={fromDateTime}&toDateTime={toDateTime}&orderBy={orderBy}&orderType={orderType}&pageSize={pageSize}&pageNumber={pageNumber}

URL Parameters

URL parameters are:

Parameter
Description
Optional
Example

searchString

User can search by pesticide name.

Yes

fromDateTime

FromDateTime in UTC.

Yes

2023-08-19T00:00:20.335Z

toDateTime

ToDateTime in UTC.

Yes

2024-05-07T23:59:20.335Z

orderBy

Order by field name (default is pesticide).

Yes

pesticide

orderType

OrderType is in ASC or DESC (default DESC).

Yes

DESC

pageSize

Number of records shown on each page.

Yes

15

pageNumber

Number of pages greater than zero.

Yes

1

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/getAllPesticides?searchString=&fromDateTime=2023-08-19T00%3A00%3A20.335Z&toDateTime=2024-05-07T23%3A59%3A20.335Z&orderBy=pesticide&orderType=DESC&pageSize=15&pageNumber=1' \
--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/getAllPesticides?searchString=&fromDateTime=2023-08-19T00:00:20.335Z&toDateTime=2024-05-07T23:59:20.335Z&orderBy=pesticide&orderType=DESC&pageSize=15&pageNumber=1',
  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/getAllPesticides?searchString=&fromDateTime=2023-08-19T00:00:20.335Z&toDateTime=2024-05-07T23:59:20.335Z&orderBy=pesticide&orderType=DESC&pageSize=15&pageNumber=1"

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:

{
    "allpesticide": [
        {
            "pesticide": "Amistar Top"
        },
        {
            "pesticide": "Folio Gold"
        }
    ]
}

API Response Parameter

The following parameters are included in API response:

Parameter
Description
Example

pesticide

The type of pesticide returned in the response

Amistar Top

PreviousGet All CropsNextAdd Flight Log

Last updated 11 months ago

Was this helpful?