geofence.report

The geofence.report command is used to generate a report of the time things spent in a specified geofence .

TR50 Request


                        // Definite time period request
{
  "cmd": {
    "command": "geofence.report",
    "params": {
      "key": "mygeofence",
      "start": "2014-01-01T00:00:00Z",
      "end": "2014-01-31T23:59:59Z"
    }
  }
}

// Last period of time request
{
  "cmd": {
    "command": "geofence.report",
    "params": {
      "key": "mygeofence",
      "last": "24h"
    }
  }
}
      

Request Parameters

Name

Type

Required

Description

key

String

 

The key of the geofence.

start

String

 

When doing a definite time period request this is the timestamp for the start of the specified time window.

end

String

 

When doing a definite time period request this is the timestamp for the end of the specified time window.

last

String

 

When doing a last period of time request this specifies the last X amount of time in nanoseconds (ns), microseconds (us), milliseconds (ms), seconds (s), minutes (m) or hours (h).

TR50 Response

If the command is sent successfully a success message is returned. Otherwise, an error and error message will be returned.


                        {
  "cmd": {
    "success": true,
    "params": {
      "things" : {
        "office": 9108146,
        "home": 41439
      }
    }
  }
}
      

Response Parameters

Name

Type

Description

geofences

Object

Key-value pairs with the key being a thing key and the value being the time spent by that thing (in seconds) in the geofence, including active durations (i.e. an enter event without a leave)..