REST API to handle geolocation
Description | Request | Response |
---|---|---|
Get the area tags for a location | GET /tags?latitude=38.0&longitude=-122.0 |
200 OK
{ "location": { "latitude": 38.0, "longitude": 132.0 } "tags": [ "CA", "San Francisco", "94123" ] } |
Get the distance from a point to the nearest area boundary | GET /nearest?latitude=38.0&longitude=-122.0 |
200 OK
{ "location": { "latitude": 38.0, "longitude": -122.0 } "distance": 1000.0, } |
Report a location and time, receiving a fence for the next report | POST /track/:id { "location": { "latitude": 38.0, "longitude": -122.0 }, "time": "2014-10-02T05:30:45.123Z" } |
200 OK
{ "circle": { "center": { "latitude": 38.0, "longitude": -122.0 }, "radius": 7400.0 }, "time": "2014-10-02T08:30:45.123Z" } |
Report a location, defaulting to the current time and receiving a fence for the next report | GET /track/:id?latitude=38.0&longitude=-122.0 |
200 OK
{ "circle": { "center": { "latitude": 38.0, "longitude": -122.0 }, "radius": 7400.0 }, "time": "2014-10-02T08:30:45.123Z" } |
Report that a device remains within a previously defined fence | GET /track/:id/checkin |
200 OK |