Get All Reports

"Effortlessly access and analyze all your reports with Aeromegh's allReports API."

The allReports API allows programmatic access to retrieve all available reports within a specified timeframe and based on certain search criteria. Authorized users can utilize this API to access reports for analysis or reference.

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 : retrieve all reports

HTTP Request

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

URL Parameters

Request Parameters:

ParameterDescriptionOptionalExample

searchString

User can search by customer name.

Yes

"John Doe"

fromDateTime

Start date and time in UTC.

Yes

2023-08-19T00:00:20.335Z

toDateTime

End date and time in UTC.

Yes

2024-05-07T23:59:20.335Z

orderBy

Field name to order the results by. Default is register_date.

Yes

"register_date"

orderType

Order type, either ASC or DESC. Default is DESC.

Yes

"DESC"

pageSize

Number of records to show on each page.

Yes

15

pageNumber

Page number, greater than zero.

Yes

1

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

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

curl --location 'https://ags.aeromegh.com/Aeromegh/getAllReports?searchString=t&fromDateTime=2023-08-19T00%3A00%3A20.335Z&toDateTime=2024-05-07T23%3A59%3A20.335Z&orderBy=created_datetime&orderType=DESC&pageSize=15&pageNumber=2' \
--header 'Authorization: Bearer <API_KEY>'

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

API Response

The API response provides comprehensive details of all available reports within the specified parameters. Each report object includes essential information such as unique identifiers, customer details, project and plan names, crop type, spray metrics, flight duration, creation timestamps, and pesticide information. This structured data facilitates efficient analysis and reference for users accessing the reports programmatically.

{
    "allReports": [
        {
            "id": "40128c02-993d-4405-bb50-3725a284a056",
            "userid": "d5dc6351-d96b-49e2-afa8-ff7d509af7aa",
            "customer_id": "247052d0-1c49-42b1-aa31-f7212092675c",
            "droneid": "P000010024003B3131510137383337",
            "customer_name": "chetan shinde",
            "project_name": "ManualProject",
            "plan_name": "SprayingPlan",
            "crop_type": "rice",
            "area_percentage": "0",
            "amount": "100",
            "spray_spacing": "3.0",
            "spray_area": "0.2494",
            "flight_time": "00:03:48",
            "created_datetime": "2024-04-05T09:28:20.000Z",
            "pesticide": "water",
            "spray_volume": "600 ml"
        },
        {
            "id": "35f74126-9eb7-4c22-826f-47324508053c",
            "userid": "d5dc6351-d96b-49e2-afa8-ff7d509af7aa",
            "customer_id": "3396b947-6e87-4fa5-a709-0382931b266e",
            "droneid": "P000010024003B3131510137383337",
            "customer_name": "chetan shinde",
            "project_name": "sandip05042024",
            "plan_name": "plan1",
            "crop_type": "rice",
            "area_percentage": "67",
            "amount": "100",
            "spray_spacing": "3.0",
            "spray_area": "0.2559",
            "flight_time": "00:03:46",
            "created_datetime": "2024-04-05T09:16:51.000Z",
            "pesticide": "water",
            "spray_volume": "13790 ml"
        }
    ]
}

API Response Parameter Details

The API response furnishes a comprehensive array of details pertaining to the generated reports. Below is a summary of the key parameters provided in the response, offering insights into each report's attributes and characteristics.

Parameter NameDescription

id

Unique identifier for the report.

userid

Unique identifier for the user associated with the report.

customer_id

Unique identifier for the customer associated with the report.

droneid

Unique identifier for the drone associated with the report.

customer_name

Name of the customer associated with the report.

project_name

Name of the project associated with the report.

plan_name

Name of the plan associated with the report.

crop_type

Type of crop associated with the report.

area_percentage

Percentage of area covered by spraying.

amount

Amount associated with the report.

spray_spacing

Spacing used for spraying.

spray_area

Total area covered by spraying.

flight_time

Duration of the flight.

created_datetime

Date and time when the report was created.

pesticide

Type of pesticide used.

spray_volume

Volume of spray used.

Last updated