Get All Pesticides

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

This API endpoint allows users to retrieve a list of all pesticides available. It provides programmatic access to pesticide data, enabling developers to integrate this information into their applications seamlessly. By utilizing this endpoint, users can efficiently fetch pesticide details, including names, quantities, and other relevant attributes. The documentation below outlines the endpoint's functionality, request parameters, and expected response format, facilitating easy integration and usage.

Authentication with API Keys

This API uses API keys for authentication. To access the API, you'll need to include a valid API key in the Authorization header of your request using the Bearer token scheme. Here's the format:

Authorization: Bearer <YOUR_API_KEY>
  • Replace <YOUR_API_KEY> with your actual API key obtained from Aeromegh.

  • Requests without a valid API key will result in 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

Request Parameters:

HTTP Response

Response Codes Explanation:

Code Snippet

Take a look at how you might call this method using our official libraries, or via curl:

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>'

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

API Response

"The API response returns a list of all pesticides, each containing the 'pesticide' parameter indicating the type of crop."

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

API Response Parameter Details

The API response includes an array of pesticide under the "allpesticide" parameter.

The following table lists the parameters returned in the API response:

Last updated