WebhooksGeotags, Geofences & Trips
Geofence
Webhook payload sent when a device enters or exits a geofence.
[
{
"device_id": "00112233-4455-6677-8899-AABBCCDDEEFF",
"driver_handle": "James",
"data": {
"arrival": {
"location": {
"coordinates": [
-122.394223, 37.792763, 822.58
],
"type": "Point"
},
"recorded_at": "2021-07-15T13:29:21.085Z"
},
"duration": 3738,
"exit": {
"location": {
"coordinates": [
-122.394223, 37.792763, 822.58
],
"type": "Point"
},
"recorded_at": "2021-07-15T14:31:38.789Z"
},
"geofence_id": "00001111-d30d-4a4a-b965-95f3f743256e",
"geofence_metadata": {
"name": "Main store"
},
"place_handle": "Store-North-Square",
"geometry": {
"coordinates": [
-122.394223, 37.792763
],
"type": "Point"
},
"marker_id": "00001111-b97b-490d-8d04-a539477df0be",
"radius": 50,
"route_to": {
"distance": 1234,
"duration": 3600,
"idle_time": 1800,
"prev_marker_id": "00001111-2dac-40a7-973b-9e3d66898a7d",
"started_at": "2021-07-15T12:29:16.424Z"
},
"value": "exit"
},
"location": {
"type": "Point",
"coordinates": [
-122.394223,
37.792763
]
},
"recorded_at": "2021-07-15T13:29:21.085Z",
"created_at": "2021-07-15T13:29:21.085Z",
"version": "2.0.0",
"type": "geofence"
}
]| Name | Type | Description |
|---|---|---|
| device_id | string | Unique device identifier, case sensitive |
| driver_handle | string | Unique identifier for a worker |
| data.arrival | object | Object representing details about the geofence arrival |
| data.arrival.location | object | Location object that triggered geofence arrival |
| data.arrival.location.type | string | As of right now, only Point is supported |
| data.arrival.location.coordinates | array | Array of longitude, latitude and (optional) elevation |
| data.arrival.recorded_at | string | ISO 8601 date when the location triggering arrival was recorded |
| data.exit | object | Object representing details about the geofence exit. Does not exist when the user is still inside the geofence. {optional} |
| data.exit.location | object | Location object that triggered geofence exit. Only set when geofence was exited due to a location. Can be empty when marker was closed to due a health event. (optional) |
| data.exit.location.type | string | As of right now, only Point is supported |
| data.exit.location.coordinates | array | Array of longitude, latitude and (optional) elevation |
| data.exit.recorded_at | string | ISO 8601 date when the event triggering exit was recorded |
| data.duration | int | Duration of the visit in [seconds] |
| data.geometry | Object | Geofence geometry of the geofence creating this marker |
| data.marker_id | String | Unique identifier for this geofence marker |
| data.place_handle | String | Unique Identifier of the place for which entry/exit is recorded. It will be present if geofence is associated with a place created via Places API |
| data.route_to | object | Object describing the route since last geofence marker (optional) |
| data.route_to.distance | int | Distance travelled since last geofence marker or start of tracking session in [meters] |
| data.route_to.duration | int | Duration since last geofence marker or start of tracking session in [seconds] |
| data.route_to.idle_time | int | Duration at stops since last geofence marker or start of tracking session in [seconds] |
| data.route_to.started_at | String | ISO 8601 Date and time when route_to calculation started |
| data.value | String | 'entry' - value indicating entry inside geofence 'exit' - value indicating exit from geofence 'delete' - value indicating that previously sent out visit was removed due to more accurate ground truth arriving* |
| location | object | Deprecated legacy payload, new users will find it null |
[*] we are adjusting geofence visits as data arrives - we get more ground truth from the sdk which can lead us to classify a previous visit as not a meaningful enough (e.g., a drive through).
our customers also rely on the detection to have low latencies. so we can't wait for all the data to arrive and the create the visits.
that's why in same cases, we send a geofence visit out and then later delete it again. it's rare that this happens