REST API: List Geofence Configs

Last Updated: November 27, 2018

Description

Retrieves a list of all geofence configs, with optional filters to narrow down the results.

Resource Information

HTTP Method GET
Endpoint https://rest.tsheets.com/api/v1/geofence_configs
Authentication Token header required. See authentication section
Request format Everything is handled through the request uri on a GET.
Response format json
Response object Jobcode Assignment

Available Filters

ids:
optional
Integer. Comma separated list of one or more geofence config ids you’d like to filter on. Only geofence configs with an id set to one of these values will be returned. If omitted, all geofence configs matching other specified filters are returned.
type:
optional
String. Comma separated list of one or more types. If specified only geofence configs of that type will be returned.
type_ids:
optional - You must also specify type when using this filter
Integer. Comma separated list of one or more type ids you'd like to filter on. Only geofence configs with a type_id set to one of these values will be returned.
enabled:
optional
Boolean. true or false. If specified only geofence configs with matching enabled values will be returned.
active:
optional
String. 'yes', 'no', or 'both'. Default is 'yes'.
modified_before:
optional
String (ISO8601 format). Only geofence configs modified before this date/time will be returned (i.e. 2004-02-12T15:19:21+00:00).
modified_since:
optional
String (ISO8601 format). Only geofence configs modified since this date/time will be returned (i.e. 2004-02-12T15:19:21+00:00).
supplemental_data:
optional
String. 'yes' or 'no'. Default is 'yes'. Indicates whether supplemental data should be returned.
per_page:
optional
Integer. Represents how many results you'd like to retrieve per request (page). Default is 50. Max is 50.
page:
optional
Integer. Represents the page of results you'd like to retrieve. Default is 1.
by_jobcode_assignment:
optional
Boolean. true or false. If specified only geofence configs related to a location that is mapped to a jobcode the user is assigned to will be returned.

Examples

Retrieve a list of all geofence configs for the current client.

## REQUEST
curl -H "Authorization: Bearer <Access-Token>" -i "https://rest.tsheets.com/api/v1/geofence_configs"

## RESPONSE
HTTP/1.1 200 OK
Content-Type: application/json

{
    "results": {
        "geofence_configs": {
            "151": {
                "id": 151,
                "type": "locations",
                "type_id": 282316,
                "active": true,
                "enabled": true,
                "radius": 150,
                "last_modified": "2017-09-07T19:09:26+00:00",
                "created": "2017-09-07T19:09:26+00:00"
            },
            "297": {
                "id": 297,
                "type": "locations",
                "type_id": 323445,
                "active": true,
                "enabled": false,
                "radius": 125,
                "last_modified": "2017-09-11T13:11:14+00:00",
                "created": "2017-09-11T13:11:14+00:00"
            }
        }
    },
    "more": false,
    "supplemental_data": {
        "locations": {
            "282316": {
                "id": 282316,
                "addr1": "1234 W Way St",
                "addr2": "",
                "city": "Eagle",
                "state": "Idaho",
                "zip": "83714",
                "country": "US",
                "active": true,
                "latitude": 43.62122110,
                "longitude": -116.34932150,
                "place_id": "",
                "place_id_hash": "8c43103323bb0b1ce7c4094029029914",
                "label": "1234 W Way St Eagle, Idaho 83714 US",
                "notes": "",
                "geocoding_status": "complete",
                "created": "2013-07-12T21:13:14+00:00",
                "last_modified": "2013-07-12T21:13:14+00:00",
                "linked_objects": {},
                "geofence_config_id": 151
            },
            "323445": {
                "id": 323445,
                "addr1": "5678 E End St",
                "addr2": "",
                "city": "Eagle",
                "state": "Idaho",
                "zip": "83714",
                "country": "US",
                "active": true,
                "latitude": -33.87904780,
                "longitude": 151.21133580,
                "place_id": "",
                "place_id_hash": "f6933fee56d6cd9e02d1dbff1a551cfa",
                "label": "5678 E End St Eagle, Idaho 83714 US",
                "notes": "",
                "geocoding_status": "complete",
                "created": "2013-07-12T21:13:14+00:00",
                "last_modified": "2013-07-12T21:13:14+00:00",
                "linked_objects": {
                 "jobcodes": [
                  2589531
                 ]
                },
                "geofence_config_id": 297
            }
        }
    }
}