Get All Reports

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

This API provides programmatic access to retrieve all reports within a specified timeframe based on search criteria, with secure API key authentication. Authorized users can use it for analysis or reference.

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

URL parameters are:

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

Examples of how you can call this API using curl, Node.js, and Python

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

Example of API response in JSON format:

{
    "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

The following parameters are included in the API response:

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