> For the complete documentation index, see [llms.txt](https://docs.fieldmotion.com/fieldmotion-api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fieldmotion.com/fieldmotion-api-docs/geofences/_getdt.md).

# \_getDT

Returns details of Geofences as a list, can also be filtered.

### Parameters

#### start

Where details begin gathering in a list of Geofences.\
(e.g If at 0, all Geofences up to the limit of "length" are checked and then returned.\
However if set to 1, the first Geofence is skipped)

#### length

The amount of Geofences checked after a number assigned by "start"\
(e.g If length is 25 and start is 0, the first 25 Geofences are checked and their details are returned)

#### draw

A number assigned to each use of this function, increases by 1 each use.\
Useful when identifying recent versions of Geofence data

```
{"draw":7,"recordsTotal":"3","recordsFiltered":"3","data":[["3","Armagh Test Area","1680439033","1680439033",""],["4","Drumshanbo Test Area","1680439109","1680439109",""],["5","Monaghan Test Area","1680442839","1680442839",""]],"_poll":[]}
```

```
{"draw":6,"recordsTotal":"3","recordsFiltered":"1","data":[["4","Drumshanbo Test Area","1680439109","1680439109",""]],"_poll":[]}
```

From these results above, the highest has a draw value of 7, therefore it's request was more recent than the lower result.

#### id

An optional filter if only one particular Geofence is desired, used to find a Geofence with the chosen ID.\
If "id" is set to 0 or not included, it is ignored.

### Examples

For these examples, the data table has only 3 Geofences, with IDs 3, 4 and 5:\
3 => Armagh Test Area\
4 => Drumshanbo Test Area\
5 => Monaghan Test Area

#### Example 1

In the below example, the first 5 Geofences in a data table are skipped and the next 20 are checked to locate one with the ID of 3.

```
FM_api(
    'Geofences_getDT',[
      'start' => '5',
      'length' => '20',
      'draw' => '1',
      'id' => '3'
    ]
);
```

When this is tried, none are found with an ID of 3, because it is the first Geofence of this example, therefore it is skipped by the "start" parameter.

```
{"draw":1,"recordsTotal":"3","recordsFiltered":"1","data":[]}
```

#### Example 2

In the below example, the first 20 Geofences are checked without any skipped, to locate one with the ID of 3.

```
FM_api(
    'Geofences_getDT',[
      'start' => '0',
      'length' => '20',
      'draw' => '2',
      'id' => '3'
    ]
);
```

The first Geofence, being the one with an ID of 3 is returned.\
The other 2 Geofences are not returned because their IDs do not match the request.

```
{"draw":2,"recordsTotal":"3","recordsFiltered":"1",
"data":[["3","Armagh Test Area","1680439033","1680439033",""]]}
```

#### Example 3

In the below example, the first Geofence is skipped and the next 2 Geofences are checked. The IDs of the Geofences are not important for this request.

```
FM_api(
    'Geofences_getDT',[
      'start' => '1',
      'length' => '2',
      'draw' => '3'
    ]
);
```

The last 2 Geofences are returned, the first Geofence is skipped.

```
{"draw":3,"recordsTotal":"3","recordsFiltered":"3",
"data":[["4","Drumshanbo Test Area","1680439109","1680439109",""],
["5","Monaghan Test Area","1680442839","1680442839",""]]}
```

### Results On Failure

If no start parameter is given or it is less than 0:

```
{"error":"missing or invalid parameter: start"}
```

If no length parameter is given or it is less than 1:

```
{"error":"missing or invalid parameter: length"}
```

If no draw parameter is given or it is less than 0:

```
{"error":"missing or invalid parameter: draw"}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://docs.fieldmotion.com/fieldmotion-api-docs/geofences/_getdt.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.
