# \_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"}
```
