# Get All Projects

This API provides programmatic access to project information from the AeroGCS Enterprise system. Authenticate with API keys and send a GET request to obtain project IDs, names, creation dates, and more. Integrate for efficient project management.

### Authentication&#x20;

To use the API, insert your API key in the Authorization header like this:

```javascript
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 : get all the projects**

### HTTP Request <a href="#http-request-33" id="http-request-33"></a>

[<mark style="color:blue;">`https://ags.aeromegh.com/AeroMegh/AeroCapture/projects/:searchString/:startIndex/:pageSize`</mark>](https://ags.aeromegh.com/AeroMegh/AeroCapture/projects/:searchString/:startIndex/:pageSize)

### URL Parameters

URL parameters are:

searchString : the search string provided by the user.

pageSize : the number of projects to display on the page.

startIndex : the starting point for the project results.

| Key            | Description             |
| -------------- | ----------------------- |
| searchString : | search project          |
| startIndex :   | get record start offset |
| pageSize :     | records on each page    |

### HTTP Response <a href="#http-response-32" id="http-response-32"></a>

Response codes explanation:

| Code | Details                    |
| ---- | -------------------------- |
| 200  | message: "ok"              |
| 400  | request parameters missing |
| 500  | internal server error      |

### Code Snippet

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

{% tabs %}
{% tab title="curl" %}

```json
  curl --location ' https://ags.aeromegh.com/:searchString/:startIndex/:pageSize' \
--header 'Authorization: Bearer <API_KEY>'  
   
```

{% endtab %}

{% tab title="Node" %}

```javascript
//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/AeroCapture/projects/12/20/50/eb4d317f-6703-44ea-83e7-5c654b1df06a',
  headers: { 
    'Authorization': 'Bearer <API_KEY>'
  }
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});



```

{% endtab %}

{% tab title="Python" %}

```python
//Please install 'requests' package first
//Set your API key before making the request

import requests

url = "https://ags.aeromegh.com/AeroMegh/AeroCapture/projects/12/20/50/eb4d317f-6703-44ea-83e7-5c654b1df06a"

payload = {}
headers = {
  'Authorization': 'Bearer <API_KEY>'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Note:** Replace **`<API_KEY>`** with the actual API\_KEY provided by Aeromegh.
{% endhint %}

### API Response

Example of API response in JSON format:

```json
{
    "projects": [
        {
            "id": "79bd643d-fd32-4fa4-ab27-14d0330d012e",
            "project_name": "13maysapkal",
            "plan_name": null,
            "created_date": "2024-05-13T07:45:17.852Z",
            "user_id": "598cc675-8126-4d62-be60-03c8d4b5e62b",
            "location_name": null,
            "location_latlng": null,
            "service": "AeroGCS Enterprise",
            "pilot_id": "st=2024-05-11T22%3A28%3A53Z&se=2025-05-13T07%3A48%3A53Z&sp=racwdl&sv=2018-03-28&sr=c&sig=ObOvuoi%2BvhAwoEls52xzM0fTgyWihK53pa%2Fyeom0aEo%3D",
            "thumb": "https://pdrlimage.blob.core.windows.net/user-598cc675-8126-4d62-be60-03c8d4b5e62b/AeroGCSWorkspace/13maysapkal/plan1/Assets/planMap.png",
            "plan_count": "2",
            "tasks": "0",
            "images": 0
        },
        {
            "id": "555679a3-9b91-47ae-a172-5b78c3a79aeb",
            "project_name": "A1",
            "plan_name": null,
            "created_date": "2024-05-06T13:28:57.623Z",
            "user_id": "598cc675-8126-4d62-be60-03c8d4b5e62b",
            "location_name": null,
            "location_latlng": null,
            "service": "AeroGCS Enterprise",
            "pilot_id": "st=2024-05-11T22%3A28%3A53Z&se=2025-05-13T07%3A48%3A53Z&sp=racwdl&sv=2018-03-28&sr=c&sig=ObOvuoi%2BvhAwoEls52xzM0fTgyWihK53pa%2Fyeom0aEo%3D",
            "plan_count": "0",
            "tasks": "0",
            "images": 0
        },
        {
            "id": "c3d8e280-dee1-49a6-92c8-c78283a49e79",
            "project_name": "proi1",
            "plan_name": null,
            "created_date": "2024-04-02T11:08:54.900Z",
            "user_id": "598cc675-8126-4d62-be60-03c8d4b5e62b",
            "location_name": null,
            "location_latlng": null,
            "service": "AeroGCS Enterprise",
            "pilot_id": "st=2024-05-11T22%3A28%3A53Z&se=2025-05-13T07%3A48%3A53Z&sp=racwdl&sv=2018-03-28&sr=c&sig=ObOvuoi%2BvhAwoEls52xzM0fTgyWihK53pa%2Fyeom0aEo%3D",
            "thumb": "https://pdrlimage.blob.core.windows.net/user-598cc675-8126-4d62-be60-03c8d4b5e62b/AeroGCSWorkspace/proi1/plan1/Assets/planMap.png",
            "plan_count": "1",
            "tasks": "0",
            "images": 0
        }
    ],
    "count": "3"
}
```

### API Response Parameter&#x20;

The following parameters are included in the API response :

| Parameter            | Description                                                                                             |
| -------------------- | ------------------------------------------------------------------------------------------------------- |
| **projects**         | An array containing information about each project.                                                     |
| **count**            | Total count of projects returned in the response.                                                       |
| **id**               | Unique identifier for the project.                                                                      |
| **project\_name**    | Name of the project.                                                                                    |
| **plan\_name**       | Name of the plan associated with the project. (null if not available)                                   |
| **created\_date**    | Date and time when the project was created.                                                             |
| **user\_id**         | Unique identifier for the user who created the project.                                                 |
| **location\_name**   | Name of the location associated with the project. (null if not available)                               |
| **location\_latlng** | Latitude and longitude coordinates of the location associated with the project. (null if not available) |
| **service**          | Service type associated with the project.                                                               |
| **pilot\_id**        | Unique identifier for the pilot associated with the project.                                            |
| **thumb**            | URL pointing to the thumbnail image of the project.                                                     |
| **plan\_count**      | Total count of plans associated with the project.                                                       |
| **tasks**            | Total count of tasks associated with the project. (null if not available)                               |
| **images**           | Total count of images associated with the project. (null if not available)                              |

Each "projects" object in the response array contains these subparameters, providing detailed information about each project.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://aerogcs-api-docs.aeromegh.com/aerogcs-enterprise-apis/get-all-projects.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
