REST API: List Geolocations

Last Updated: November 07, 2016

Description

Retrieves a list of geolocations associated with your company, with filters to narrow down the results.

Resource Information

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

Available Filters

ids:
required - unless modified_before or modified_since is set
Integer. Comma separated list of one or more geolocation ids you'd like to filter on. Only geolocations with an id set to one of these values will be returned.
modified_before:
required - unless ids or modified_since is set
String (ISO8601 format). Only geolocations modified before this date/time will be returned (i.e. 2004-02-12T15:19:21+00:00).
modified_since:
required - unless ids or modified_before is set
String (ISO8601 format). Only geolocations modified since this date/time will be returned (i.e. 2004-02-12T15:19:21+00:00).
user_ids:
optional
Integer. A comma-separated list of user ids. Only geolocations linked to these users will be returned.
group_ids:
optional
Integer. A comma-seperated list of group ids. Only geolocations linked to users from these groups will be returned.
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.

Examples

Retrieve a list of all geolocations modified since August of 2013.

## REQUEST
curl -H "Authorization: Bearer <Access-Token>" -i "https://rest.tsheets.com/api/v1/geolocations?modified_since=2013-08-01T12:00:00-06:00"

## RESPONSE (shortened for readability)
HTTP/1.1 200 OK
Content-Type: application/json

{
 "results": {
  "geolocations": {
   "185648268": {
    "id": 185648268,
    "user_id": 29474,
    "accuracy": 21,
    "altitude": 0,
    "latitude": 43.6866258,
    "longitude": -116.3516646,
    "created": "2013-08-16T17:56:57+00:00"
   },
   "185648270": {
    "id": 185648270,
    "user_id": 29474,
    "accuracy": 20,
    "altitude": 0,
    "latitude": 43.6866377,
    "longitude": -116.3516499,
    "created": "2013-08-16T17:57:24+00:00"
   },
   "185648320": {
    "id": 185648320,
    "user_id": 29474,
    "accuracy": 20,
    "altitude": 0,
    "latitude": 43.6866377,
    "longitude": -116.3516499,
    "created": "2013-08-16T17:57:27+00:00"
   },
   "185648322": {
    "id": 185648322,
    "user_id": 29474,
    "accuracy": 20,
    "altitude": 0,
    "latitude": 43.6866371,
    "longitude": -116.351654,
    "created": "2013-08-16T17:57:42+00:00"
   },
   "185648324": {
    "id": 185648324,
    "user_id": 29474,
    "accuracy": 21,
    "altitude": 0,
    "latitude": 43.6866282,
    "longitude": -116.3516624,
    "created": "2013-08-16T17:58:07+00:00"
   },
   ...
}