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 Customers

This API is used to retrieve all registered and unregistered drones.

This API provides programmatic access to retrieve all customer records 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 customer's

HTTP Request

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

URL Parameters

URL parameters are:

Parameter
Description
Optional
Example

searchString

Allows users to search by customer name.

Yes

"John Doe"

fromDateTime

Specifies the start date and time in UTC.

Yes

"2023-08-19T00:00:20.335Z"

toDateTime

Specifies the end date and time in UTC.

Yes

"2024-05-07T23:59:20.335Z"

orderBy

Specifies the field name to order results by.

Yes

"register_date"

orderType

Specifies the order type; ASC or DESC.

Yes

"DESC"

pageSize

Specifies the number of records per page.

Yes

15

pageNumber

Specifies the page number; must be 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/getAllCustomers?searchString=&fromDateTime=2023-08-19T00%3A00%3A20.335Z&toDateTime=2024-05-07T23%3A59%3A20.335Z&orderBy=register_date&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/getAllCustomers?searchString=&fromDateTime=2023-08-19T00:00:20.335Z&toDateTime=2024-05-07T23:59:20.335Z&orderBy=register_date&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/getAllCustomers?searchString=&fromDateTime=2023-08-19T00:00:20.335Z&toDateTime=2024-05-07T23:59:20.335Z&orderBy=register_date&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:

{
    "allCustomers": [
        {
            "id": "97c4383c-f477-4cb3-8775-727bd0d375ac",
            "userid": "d5dc6351-d96b-49e2-afa8-ff7d509af7aa",
            "customer_name": "chetan shinde",
            "contact_number": null,
            "address": null,
            "email": null,
            "register_date": "2024-04-24T12:14:03.900Z",
            "government_id": null,
            "pilot_license_id": null,
            "gst_no": null,
            "cust_type": "green",
            "totalAcres": "16.5562",
            "totalRevenue": "15405",
            "reportStatCrop": [
                {
                    "crop_type": "rice"
                },
                {
                    "crop_type": "rice "
                },
                {
                    "crop_type": "rics"
                }
            ]
        },
        {
            "id": "8d5fcb25-8e01-44fc-9cff-8a7701f5b326",
            "userid": "d5dc6351-d96b-49e2-afa8-ff7d509af7aa",
            "customer_name": "chetan shinde",
            "contact_number": null,
            "address": null,
            "email": null,
            "register_date": "2024-04-05T09:32:03.498Z",
            "government_id": null,
            "pilot_license_id": null,
            "gst_no": null,
            "cust_type": "green",
            "totalAcres": "2.47",
            "totalRevenue": "100",
            "reportStatCrop": [
                {
                    "crop_type": "rice"
                }
            ]
        }
    ]
}

API Response Parameter

The following parameters are included in API response:

Parameter Name
Description

id

Unique identifier for each customer.

userid

Identifier for the user associated with the customer.

customer_name

Name of the customer.

contact_number

Contact number of the customer.

address

Address of the customer.

email

Email address of the customer.

register_date

Date and time of customer registration.

government_id

Government-issued identification number, if available.

pilot_license_id

Pilot license ID, if applicable.

gst_no

Goods and Services Tax (GST) number, if available.

cust_type

Type of customer (e.g., green, premium, standard).

totalAcres

Total acres managed by the customer.

totalRevenue

Total revenue generated by the customer.

reportStatCrop

An array containing objects specifying crop types and their statistics for each customer. Each object includes the following subparameters:

PreviousGet All ReportsNextGet All Crops

Last updated 11 months ago

Was this helpful?