Location Data


The optional location field for Drop data can be specified by decimal Latitude (lat) and Longitude (lon) upon creation, both of which must be floats, or a map of specifiers, which can be of following keys:

  • street
  • city
  • state
  • zip

If you only supply the zip on input, the lat and lon will be calculated and returned to you on output.

To set all fields in the value of a location in a drop:

{
    "path": "/my_account_id/my_first_flow",
    "location": {
        "lat": 40.703285,
        "lon": -73.987852,
        "specifiers": {
            "city": "New York City",
            "zip": "11201",
            "street": "155 Water Street",
            "state": "NY"
        }
    },
    "elems": {
        "name": "my location"
    }
}

To set the value of a location where you only know the zip code, the service will convert the zip code into a decimal lat/long based on the center of the zip code:

{
    "path": "/my_account_id/my_first_flow",
    "location": {
        "specifiers": {
            "zip": "11201"
        }
    },
    "elems": {
        "name": "just my zip"
    }
}

Filter examples:

HTTP 1.1 GET https://<base_url>/drop/flowId?filter=location WITHIN 500 MILES OF [40.8, 74]
HTTP 1.1 GET https://<base_url>/drop/flowId?filter=location WITHIN 26.2 MILES OF [ZIP="11204"]
HTTP 1.1 GET https://<base_url>/drop/flowId?filter=location.$zip == '11201'
HTTP 1.1 GET https://<base_url>/drop/flowId?filter=location.$latitude > 0.09
HTTP 1.1 GET https://<base_url>/drop/flowId?filter=location.$longitude > 0.18
HTTP 1.1 GET https://<base_url>/drop/flowId?filter=location.$street == '155 Water Street'
HTTP 1.1 GET https://<base_url>/drop/flowId?filter=location.$city == 'New York City'
HTTP 1.1 GET https://<base_url>/drop/flowId?filter=location.$state == 'NY'
HTTP 1.1 GET https://<base_url>/drop/flowId?filter=EXISTS location
HTTP 1.1 GET https://<base_url>/drop/flowId?filter=HAS location