REST API: List Locations Maps

Last Updated: October 16, 2018

Description

Retrieves a list of all locations maps associated with your company, with optional filters to narrow down the results.

Resource Information

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

Available Filters

ids:
optional
Integer. Comma separated list of one or more locations map ids you'd like to filter on. Only locations maps with an id set to one of these values will be returned. If omitted, all locations maps matching other specified filters are returned.
active:
optional
String. 'yes', 'no', or 'both'. Default is 'yes'.
modified_before:
optional
String (ISO8601 format). Only locations maps modified before this date/time will be returned (i.e. 2004-02-12T15:19:21+00:00).
modified_since:
optional
String (ISO8601 format). Only locations maps modified since this date/time will be returned (i.e. 2004-02-12T15:19:21+00:00).
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 locations maps mapped to a jobcode the user is assigned to will be returned.

Examples

Retrieve a list of all active locations maps.

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

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

{
 "results": {
  "locations_map": {
   "102839": {
    "id": 102839,
    "x_table": "job_codes",
    "x_id": 2597003,
    "location_id": 237053,
    "created": "2018-06-20T14:14:26+00:00",
    "last_modified": "2018-08-01T10:31:16+00:00"
   },
   "110761": {
    "id": 110761,
    "x_table": "job_codes",
    "x_id": 3003037,
    "location_id": 268919,
    "created": "2018-07-10T14:33:14+00:00",
    "last_modified": "2018-08-01T10:31:16+00:00"
   }
  }
 },
 "supplemental_data": {
  "locations": {
   "237053": {
    "id": 237053,
    "addr1": "1234 N Back Rd",
    "addr2": "",
    "city": "Eagle",
    "state": "ID",
    "zip": "83616",
    "formatted_address": "1234 N Back Rd, Eagle, ID 83616",
    "country": "US",
    "active": true,
    "latitude": 43.648051,
    "longitude": -116.353473,
    "place_id": "",
    "place_id_hash": "a08b7c81255ef0d67f5c2a0e55858c1b",
    "label": "1234 North Back Road, Eagle, ID, USA",
    "notes": "",
    "geocoding_status": "complete",
    "created": "2018-06-26T19:49:55+00:00",
    "last_modified": "2018-06-26T19:49:55+00:00",
    "linked_objects": {
    "jobcodes": [
     2597003
    ]
    },
    "geofence_config_id": 116905
   },
   "268919": {
    "id": 268919,
    "addr1": "5678 E Cole Dr",
    "addr2": "",
    "city": "Eagle",
    "state": "ID",
    "zip": "83616",
    "formatted_address": "5678 E Cole Dr, Eagle, ID 83616",
    "country": "US",
    "active": true,
    "latitude": 43.670013,
    "longitude": -116.3521704,
    "place_id": "",
    "place_id_hash": "d6c4ea86ec37bf0fa5e01194d19adf29",
    "label": "5678 East Cole Drive, Eagle, ID, USA",
    "notes": "",
    "geocoding_status": "complete",
    "created": "2018-07-10T14:33:14+00:00",
    "last_modified": "2018-07-10T14:33:14+00:00",
    "linked_objects": {
     "jobcodes": [
      3003037
     ]
    },
    "geofence_config_id": null
   }
  }
 }
}
    

Retrieve a list of locations maps with ids 12, 367, and 3489.

## REQUEST
curl -H "Authorization: Bearer <Access-Token>" -i "https://rest.tsheets.com/api/v1/locations_map?ids=12,367,3489"

## RESPONSE
## (response would have the same layout as the above examples)
    

Retrieve a list of locations maps that have been modified since Jan 1, 2013

## REQUEST
## Note that instead of a plus, we're using '%2B', the url-encoded equivalent - to prevent the + getting replaced by a space.
curl -H "Authorization: Bearer <Access-Token>" -i "https://rest.tsheets.com/api/v1/locations_map?modified_since=2013-01-01T00:00:00%2B00:00"

## RESPONSE
## (response would have the same layout as the above examples)