Skip to main content

Finding Equipments

To fetch specific data from an equipment, you first need to retrieve a list of your equipments and their corresponding IDs. This initial step is crucial because most data retrieval operations require a unique asset identifier. Once you have these IDs, you can accurately target and request the precise data you need from each piece of equipment.

Common Asset Search Request Schema

When querying for assets, the following parameters define the structure of your search requests. This schema allows for flexible filtering to retrieve specific asset information.

  • assetIds (UUID array of strings, optional): Directly retrieve assets by their unique identifiers. This is the preferred method for specific asset retrieval.
  • assetType (enum, optional): Filter assets by their general type (e.g., VALVE, PUMP, etc).
  • assetGroupIds (UUID array of strings, optional): Filter assets that belong to specific asset groups.
  • assetGroupType (enum, optional): Filter assets based on the type of asset group they belong to.
  • equipmentType (string or array of strings, optional): Filter assets by one or more specific equipment types.
  • includeDeleted (boolean, optional): Set to true to include soft-deleted assets in the search results. Defaults to false.
  • searchName (string, optional): Perform a partial match search on the asset's name.
info

Due to the large number of potential parameters for asset search queries, we've opted to use POST requests instead of GET for these operations. While this might not strictly align with RESTful semantics (as GET is typically for data retrieval), it addresses practical limitations.

Passing these arguments in a GET request's body can sometimes lead to issues with proxy servers and is not universally supported. While a QUERY method would be ideal for such complex searches, it's currently only a draft specification. Therefore, using POST with parameters in the request body provides the most reliable and robust solution for our asset search functionality.

Retrieving Equipment List

In the IrrigEasy data model, water networks are represented as "Farm Blocks." Therefore, before you can query for a specific equipment, you'll need to:

  1. Retrieve the list of available Farm Blocks via our API. This will give you the unique identifiers for each of your water networks.

Request

POST https://api.telaqua.com/assets/searches
{
"assetType": "Group"
}

Response

[
{
"id": "265c79cc-8b23-4e1b-bb23-582a6ad45d50",
"type": "Group",
"name": "Hermès",
"groupType": "FarmBlock"
}
]
  1. Once you have the id for a particular network, you can then use that id to request the list of equipments associated with that specific water network.

Request

POST https://api.telaqua.com/assets/searches
{
"assetGroupIds": ["265c79cc-8b23-4e1b-bb23-582a6ad45d50"]
}

Response

[
{
"id": "a5fd205c-56a3-440f-bfa7-fefa88a1ff24",
"type": "Equipment",
"name": "Valve A1",
"equipmentType": "VALVE"
},
{
"id": "f4764de3-fdb4-474a-81e5-e720097eee0d",
"type": "Equipment",
"name": "Valve A2",
"equipmentType": "VALVE"
},
{
"id": "c60b9565-b2b4-4de3-a182-ee3fbcb6238a",
"type": "Equipment",
"name": "Valve B1",
"equipmentType": "VALVE"
},
{
"id": "3653f41f-749c-4f2a-a0bb-5a06aa91616a",
"type": "Equipment",
"name": "Valve B2",
"equipmentType": "VALVE"
},
{
"id": "2c37ad05-379b-4823-a105-e1b5e5aab5e6",
"type": "Equipment",
"name": "Pompe A",
"equipmentType": "PUMP"
}
]